Merge branch 'release' of 47.111.118.107:wmtx/platform into feature/channel_fee

master
sunke
commit 2d0cc98077

@ -1865,7 +1865,7 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
foreach ($data['statement_info'] as $key => $value) {
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1)->mergeCells("J$line:K$line");
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']);
if ($value['statement_type'] == 1) {//罚款
if ($value['statement_type'] > 0) {//罚款
$product_name = $value['type_name'];
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line , '-');
$objPHPExcel->getActiveSheet()->setCellValue('G'.$line, '-');
@ -1950,7 +1950,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->removeConditionalStyles();
$objPHPExcel->getActiveSheet()->setCellValue('A'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']);
if ($value['statement_type'] == 1) {//罚款
if ($value['statement_type']>0) {//罚款
$product_name = $value['type_name'];
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, '-');
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, '-');

@ -241,6 +241,51 @@ class FileController extends AdminController
$this->ajaxReturn($return);
}
/**
* 上传图片
* @author huajie <banhuajie@163.com>
*/
public function uploadPictureNotLimit()
{
//TODO: 用户登录检测
/* 返回标准数据 */
$return = array('status' => 1, 'info' => '上传成功', 'data' => '');
/* 调用文件上传组件上传文件 */
$Picture = D('Picture');
$pic_driver = C('PICTURE_UPLOAD_DRIVER');
$info = $Picture->upload(
$_FILES,
C('PICTURE_UPLOAD'),
C('PICTURE_UPLOAD_DRIVER'),
C("UPLOAD_{$pic_driver}_CONFIG"),
$_REQUEST['flag']
); //TODO:上传到远程服务器
// 添加水印
// if ($_REQUEST['flag']) {
// $this->addWatermarkOnPic($info['download']);
// }
/* 记录图片信息 */
if ($info) {
$return['status'] = 1;
if (empty($info['download'])) {
$file = $info['file'];
} else {
$file = $info['download'];
}
$return = array_merge($file, $return);
} else {
$return['status'] = 0;
$return['info'] = $Picture->getError();
}
ob_clean();
/* 返回JSON数据 */
$this->ajaxReturn($return);
}
public function uploadDoc()
{

@ -17,6 +17,8 @@ use BaiduBce\Services\Bos\CannedAcl;
use BaiduBce\Services\Bos\BosOptions;
use BaiduBce\Auth\SignOptions;
use BaiduBce\Log\LogFactory;
use Admin\Model\AuthRuleModel;
use Admin\Model\AuthGroupModel;
use Base\Service\GameService;
/**
@ -301,9 +303,46 @@ class GameController extends ThinkController
}
}
public function delSociatyGames() {
$res = ['code' => 10000];
$id = $_REQUEST['id'];
$delRest = M('sociaty_games','tab_')->where(['id'=>$id])->delete();
if($delRest) {
$res['code'] = 10001;
$this->ajaxReturn($res);
}
}
public function edit($id = null)
{
if (IS_POST) {
if(!empty($_REQUEST['apply_auth'])) {
$gameData['apply_auth'] = $_REQUEST['apply_auth'];
$game_appid = $_REQUEST['game_appid'];
$gameId = M('game','tab_')->where(['game_appid' => $game_appid])->getField('id');
M('game','tab_')->where(['id'=>$gameId])->save($gameData);
if($_REQUEST['apply_auth'] == 1) {
M('sociaty_games','tab_')->where(['game_id'=>$gameId])->delete();
}
if(!empty($_REQUEST['promote_data'])) {
$promote_data = json_decode($_REQUEST['promote_data'],TRUE);
$game_appid = $_REQUEST['game_appid'];
$gameId = M('game','tab_')->where(['game_appid' => $game_appid])->getField('id');
$gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$gameId])->select();
$dataList = array();
foreach($promote_data as $key => $promoteInfo) {
$isSociaty = M('sociaty_games','tab_')->where(['promote_id'=>intval($promoteInfo['value']),'game_id'=>intval($gameId)])->getField('id');
if(!empty($isSociaty)) {
// $this->error("选择会长中有已存在会长");
}else {
$dataList[] = ['promote_id' => intval($promoteInfo['value']),'game_id' => intval($gameId),'status'=>$gameInfo[0]['game_status'],'create_time'=>time()];
}
}
M('sociaty_games','tab_')->addAll($dataList);
}
// $_REQUEST['apply_auth'] == 1 ? $this->success('开放全部会长权限成功') : $this->success('设置会长权限成功');
}
if ($_POST['game_score'] < 0 || $_POST['game_score'] > 5) {
$this->error('游戏评分只能为0-5之间的数字');
exit;
@ -419,7 +458,30 @@ class GameController extends ThinkController
$data['icon_data'] = explode(',', $data['icon']);
}
$apply_auth = M('game','tab_')->where(['id'=>$id])->getField('apply_auth');
$this->assign('apply_auth',$apply_auth);
$sociatyGames = M('sociaty_games','tab_')->where(['game_id'=>$id])->select();
$sociatyGamesData = [];
if(!empty($sociatyGames)) {
foreach($sociatyGames as $key => $value) {
$sociatyGamesData[$key]['id'] = $value['id'];
if($value['promote_id'] == -1) {
$sociatyGamesData[$key]['promoteAccount'] = "官方渠道";
}else {
$promoteAccount = M('promote','tab_')->where(['id'=>$value['promote_id']])->getField('account');
$sociatyGamesData[$key]['promoteAccount'] = $promoteAccount;
}
$sociatyGamesData[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
$applyStatus = M('apply','tab_')->field('id')->where(['game_id'=>$value['game_id'],'status'=>1])->select();
if(empty($applyStatus)) {
$sociatyGamesData[$key]['isPromote'] = "否";
}else {
$sociatyGamesData[$key]['isPromote'] = "是";
}
}
}
$this->assign('sociatygames',$sociatyGamesData);
$data['introduction'] = str_replace("~~", "\r\n", $data['introduction']);
$this->assign('data', $data);
$this->assign('game_id', $id);
@ -430,6 +492,11 @@ class GameController extends ThinkController
$this->m_title = '游戏列表';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Game/lists', 'status' => 1])->find());
$this->assign('game_ratio',$game_ratio);
$auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
->getfield('id,id,title,rules');
$empower_type = M('AuthGroup')->field('data_empower_type')->where(array('id'=>1))->find();
$this->assign('data_empower_type', $empower_type['data_empower_type']);
$this->assign('auth_group', $auth_group);
$this->display();
}
}
@ -906,4 +973,92 @@ class GameController extends ThinkController
//M('cp_game_ratio', 'tab_')->where("id=".$_POST['data_id'])->data(array("is_del"=>"1","update_time"=>time()))->save();
echo(json_encode(array("result"=>"1","desc"=>"删除成功")));
}
public function uploadExcel1() {
Vendor("PHPExcel.PHPExcel");
$gid = $_REQUEST['game_id'];
if(@is_uploaded_file($_FILES['file']['tmp_name'])){
$upfile = $_FILES["file"];
$name = $upfile["name"];
$type = $upfile["type"];
$size = $upfile["size"];
$tmp_name = $upfile["tmp_name"];
$savePath = $_SERVER['DOCUMENT_ROOT'].__ROOT__.'/Uploads/Excel/';
move_uploaded_file($tmp_name,$savePath.$name);
$file_name = $savePath.$name;
$error=$upfile["error"];//上传后系统返回的值
$extension = strtolower( pathinfo($file_name, PATHINFO_EXTENSION) );
if($extension == 'xlsx') {
$objReader = \PHPExcel_IOFactory::createReader('excel2007');
}elseif($extension == 'csv') {
$objReader = \PHPExcel_IOFactory::createReader('csv');
}else {
$objReader = \PHPExcel_IOFactory::createReader('Excel5');//创建读取实例
}
$objPHPExcel = $objReader->load($file_name,$encode='utf-8');//加载文件
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
$dataList = [];
$outPromote = []; //录入出错的会长
$outGame = []; //录入出错的游戏
$successAccount = [];
$keyPro = 0;
$keyGame = 0;
$keyData = 0;
for($i=2;$i<=$highestRow;$i++)
{
$promoteAccount = $objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue();
$promoteInfo = M('promote','tab_')->field('id')->where(['account' => $promoteAccount ])->find();
if($promote_id == -1) {$promoteInfo['account'] = "官方渠道"; }
if(empty($promoteInfo)) {
$outPromote[$keyPro]['promote_account'] = $promoteAccount;
$keyPro += 1;
}else {
$promote_id = $promoteInfo['id'];
}
$gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$gid])->select();
$time = time();
$isSociaty = M('sociaty_games','tab_')->where(['promote_id'=>$promote_id,'game_id'=>$gid])->getField('id');
if(empty($isSociaty) && !empty($gameInfo) && !empty($promoteInfo)) {
$dataList[$keyData] = ['promote_id'=>$promote_id,'game_id'=>$gid,'status'=>$gameInfo[0]['game_status'],'create_time'=>$time];
$successAccount[$keyData] = ['account'=>$promoteAccount];
$keyData += 1;
}
}
$backData['outPromote'] = $outPromote;
$backData['datalist'] = $successAccount;
M('sociaty_games','tab_')->addAll($dataList);
$gameData['apply_auth'] = 2;
M('game','tab_')->where(['id'=>$gid])->save($gameData);
$this->ajaxReturn(json_encode($backData,TRUE));
}
}
function getRootPromote() {
$promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select();
$data_president = M('AuthGroup')->field('data_president')->where(array('id'=>1))->find();
$promoteData = array_merge([0=>['value'=>'-1','title'=>'官方渠道']],$promoteData);
$returnData = array('data_president'=>$data_president['data_president'],'list'=>$promoteData);
$this->ajaxReturn(json_encode($returnData));
}
//下载模板
public function downloadDemo() {
$game_id = $_REQUEST['game_id'];
$game_name = M('game','tab_')->where(['id'=>$game_id])->getField('game_name');
$data[] = [
'promoteid' => "官方渠道",
];
$field = array(
"promoteid"=>"会长账号",
);
data2csv($data,'【'.$game_name.'】'.'模板',$field);
}
}

@ -1352,6 +1352,7 @@ class PromoteController extends ThinkController
'verify_status' => $verify_status,
'approver_id' => getAdmin(),
'approver_name' => getAdmin('username'),
'verify_time' => time()
]);
if (!is_null($res) ) {
if ($verify_status == 1) {//审核通过才修改推广员的归属关系
@ -1374,4 +1375,134 @@ class PromoteController extends ThinkController
}
public function certification()
{
if ($_POST) {
$promoteId = intval(I('post.id', 0));
if (empty($promoteId)) {
$this->error('参数异常');
}
$promote = D('promote')->field('real_name, idcard, mobile_phone')->where(array('id' => $promoteId))->find();
if (empty($promote)) {
$this->error('参数异常');
}
if (empty($promote['real_name']) || $promote['real_name'] != I('post.real_name', '')) {
if (empty($_POST['real_name'])) {
$this->error('真实姓名不能为空');
}
$save['real_name'] = I('post.real_name', '');
}
if (empty($promote['idcard']) || $promote['idcard'] != I('post.idcard', '')) {
if (empty($_POST['idcard'])) {
$this->error('身份证号码不能为空');
}
if(!is_idcard($_POST['idcard'])) {
$this->error('证件号码错误');
}
$save['idcard'] = I('post.idcard', '');
}
if (empty($promote['mobile_phone']) || $promote['mobile_phone'] != I('post.mobile_phone', '')) {
if (empty($_POST['mobile_phone'])) {
$this->error('手机号码不能为空');
}
$patternPhone = "/^1[3|5|7|8]\\d{9}$/i";
if(!preg_match($patternPhone, $_POST['mobile_phone'])) {
$this->error("手机号码格式不合法");
}
$save['mobile_phone'] = I('post.mobile_phone', '');
}
if (empty($_POST['idcarpic'])) {
$this->error('身份证证件照不能为空');
}
if (empty($_POST['s_province'])) {
$this->error('联系省份不能为空');
}
if (empty($_POST['s_city'])) {
$this->error('联系地级市不能为空');
}
if (empty($_POST['s_county'])) {
$this->error('联系市、县级市不能为空');
}
if (empty($_POST['s_address'])) {
$this->error('详细地址不能为空');
}
if (empty($_POST['email'])) {
$this->error('邮箱不能为空');
}
$patternEmail = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
if (!preg_match($patternEmail, $_POST['email'])) {
$this->error('邮箱地址错误');
}
if (empty($_POST['account_type'])) {
$this->error('账户类型不能为空');
}
if (empty($_POST['bank_name'])) {
$this->error('开户银行不能为空');
}
if (empty($_POST['bank_account'])) {
$this->error('银行户名不能为空');
}
$patternBankAccount = "/^[\x{4e00}-\x{9fa5}]{2,}$/u";
if (!preg_match($patternBankAccount, $_POST['bank_account'])) {
$this->error('银行卡开户人姓名错误');
}
if (empty($_POST['bank_card'])) {
$this->error('卡号不能为空');
}
$patternBankCard = "/^\d{10,19}$/u";
if (!preg_match($patternBankCard, $_POST['bank_card'])) {
$this->error('卡号格式错误');
}
$save['id'] = $promoteId;
$save['ver_status'] = 1;
$save['idcarpic'] = I('post.idcarpic', '');
$save['address'][] = I('post.s_province', '') . ',' . I('post.s_city', '') . ',' . I('post.s_county', '');
$save['address'][] = I('post.s_address', '');
$save['address'] = json_encode($save['address']);
$save['email'] = I('post.email', '');
$save['account_type'] = intval(I('post.account_type', 1));
$save['bank_name'] = I('post.bank_name', '');
$save['bank_account'] = I('post.bank_account', '');
$save['bank_card'] = I('post.bank_card', '');
if (isset($_POST['businesspic'])) {
$save['businesspic'] = I('post.businesspic', '');
}
if (isset($_POST['agreementpic'])) {
$save['agreementpic'] = I('post.agreementpic', '');
}
if (isset($_POST['anothpic'])) {
$save['anothpic'] = I('post.anothpic', '');
}
$result = D('promote')->save($save);
if ($result === false) {
$this->error('操作失败');
} else {
$this->success('操作成功');
}
} else {
$promoteId = intval(I('id', 0));
if ($promoteId <= 0) {
$this->error('参数错误');
}
$promote = D('promote')->where(array('id' => $promoteId))->find();
$promote['idcarpic_array'] = $promote['idcarpic'] ? explode(',', $promote['idcarpic']) : [];
$promote['businesspic_array'] = $promote['businesspic'] ? explode(',', $promote['businesspic']) : [];
$promote['agreementpic_array'] = $promote['agreementpic'] ? explode(',', $promote['agreementpic']) : [];
$promote['anothpic_array'] = $promote['anothpic'] ? explode(',', $promote['anothpic']) : [];
$promote['address'] = json_decode($promote['address'], true);
if (!empty($promote['address'])) {
foreach ($promote['address'] as &$address) {
$address = explode(',', $address);
}
}
$this->assign('records', $promote);
$this->assign('meta_title', '资质认证');
$this->display();
}
}
}

@ -346,7 +346,7 @@ class PublicController extends \Think\Controller
public function telsafecode($phone = '', $delay = 10, $flag = true)
{
$taskClient = new TaskClient();
$result = $taskClient->sendSmsCode($phone, get_client_ip());
$result = $taskClient->sendSms($phone, get_client_ip());
$data = [];
if ($result['code'] == TaskClient::SUCCESS) {
$data['status'] = 1;

@ -1239,10 +1239,10 @@ class QueryController extends ThinkController
$save['audit_time'] = time();
$save['status'] = $status;
$res = $withdraw->where($map)->save($save);
if ($res === false) {
$this->error('操作失败');
} else {
if ($res) {
$this->success('操作成功', U('withdraw'));
} else {
$this->error('操作失败');
}
}

@ -44,6 +44,7 @@
<li data-tab="tab3" ><a href="javascript:void(0);">参数配置</a></li>
<li data-tab="tab4" ><a href="javascript:void(0);">H5分享页面</a></li>
<li data-tab="tab5" ><a href="javascript:void(0);">用户等级设置</a></li>
<li data-tab="tab6" ><a href="javascript:void(0);">推广配置</a></li>
</ul>
<h3 class="page_title">编辑游戏【{$data.relation_game_name}】</h3>
<p class="description_text">说明:查看和编辑游戏的基础信息、下载设置、参数信息等。</p>
@ -923,7 +924,92 @@
<tbody>
</table>
</div>
<!--推广配置-->
<div id="tab6" class="tab-pane tab6 ">
<input type="button" id="addpromote" onclick="addPromote()" style="background: #3E96C9;color:white;border:none;outline: none;width:90px;height:30px;border-radius: 3px;" value="添加" />
<div class="data_list data_game_list" id="addpromoteindex" style="margin-top:20px;">
<div class="">
<table>
<thead>
<tr>
<th>会长账号</th>
<th>添加时间</th>
<th>是否已进行推广</th>
<th style="width:10%;min-width:150px;">操作</th>
</tr>
</thead>
<tbody>
<if condition="$apply_auth eq 2">
<empty name ="sociatygames">
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="sociatygames" id="data">
<tr>
<td>{$data['promoteAccount']}</td>
<td>{$data['create_time']}</td>
<td>{$data['isPromote']}</td>
<td class="" style="color:red"><a href="javascript:void()" onclick="del({$data['id']})">移除</a></td>
</tr>
</volist>
</empty>
<else/>
<td colspan="14" class="text-center">该游戏未设置会长权限,现面对所有会长开放!</td>
</if>
</tbody>
</table>
</div>
</div>
<table border="0" cellspacing="0" cellpadding="0" id="promoteset" style="display:none">
<tbody >
<tr style="display:block;width:600px;" >
<td class="l">推广限制</td>
<td class="r" >
<input type="radio" class="inp_radio js-device js-devices{$key}" value="0" id="all" name="apply_auth" checked> 全部会长可申请
<input type="radio" class="inp_radio js-device js-devices{$key}" value="0" id="part" name="apply_auth" style="margin-left:20px"> 部分会长可申请
</td>
</tr>
<tr style="display:none;width:600px;" id="addtype">
<td class="l" >添加方式</td>
<td class="r" >
<input type="radio" class="inp_radio js-device js-devices{$key}" value="" id="excel" name="" checked> EXCEL导入
<input type="radio" class="inp_radio js-device js-devices{$key}" value="" id="partchoose" name="" style="margin-left:20px"> 批量选择
</td>
</tr>
<tr style="display:none" id="moban">
<td class="l">EXCEL模板</td>
<td class="r" >
<a href="{:U('downloadDemo',['game_id'=>$game_id])}">下载模板</a>
</td>
</tr>
<tr style="display:none" id="daoru">
<td class="l">导入模板</td>
<td class="r" >
<input type="file" name="upfile" id="file_excel" style="width:200px"/>
<input type="button" onclick="suba({$game_id})" style="background: #3E96C9;color:white;border:none;outline: none;width:70px;height:30px;border-radius: 3px;" value="导入" />
</td>
</tr>
</tbody>
</table>
<div class="data_list data_game_list" id="data_list"></div>
<link rel="stylesheet" type="text/css" href="__STATIC__/layui-v2.5.5/css/layui.css">
<input type="hidden" name="group_id" id="group_id" value="{$_GET['group_id']}">
<input type="hidden" name="promote_data" id="promote_data" value="[]">
<div id="transfer_promote" class="demo-transfer" style="margin-left: 100px;margin-top: 35px;display:none"></div>
</div>
<div class="form-item cf">
<input type="hidden" name='id' value="{$data['id']}" />
<input type="hidden" name='type' value="{$_GET['type']}" />
@ -952,7 +1038,198 @@
</block>
<block name="script">
<script src="__STATIC__/layui-v2.5.5/layui.all.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script>
var dataTransfer = '';
$.ajax({
url: "{:U('getRootPromote')}",
type: "post",
data: {group_id: 1},
dataType: 'json',
success: function (data) {
console.log(data,'datadadaa')
// datas = data;
layui.use(['transfer', 'layer', 'util'], function(){
var $ = layui.$
,transfer = layui.transfer
,layer = layui.layer
,util = layui.util;
var data1 =data;
if (JSON.parse(data1).data_president) {
var data2 = JSON.parse(data1).data_president.split(",");
}
// var dataTransfers = transfer.getData('key123');
// $('#promote_data').val(JSON.stringify(dataTransfers));
//显示搜索框
transfer.render({
elem: '#transfer_promote'
,data: JSON.parse(data1).list
,title: ['全部成员', '选中成员']
,showSearch: true,
value: data2,
id: 'key123',
onchange: function(data, index){
dataTransfer = transfer.getData('key123'); //获取右侧数据
// layer.alert(JSON.stringify(dataTransfer));
$('#promote_data').val(JSON.stringify(dataTransfer));
}
})
var dataTransfers = transfer.getData('key123');
$('#promote_data').val(JSON.stringify(dataTransfers));
transfets = transfer;
//批量办法定事件
util.event('lay-demoTransferActive', {
getData: function(othis){
var getData = transfer.getData('key123'); //获取右侧数据
layer.alert(JSON.stringify(getData));
}
});
});
}
});
</script>
<script type="text/javascript">
$("#part").click(function() {
var addtype = document.getElementById("addtype");
addtype.style.display = "block"
$("#part").attr('checked',true)
$("#all").attr('checked',false)
var moban = document.getElementById("moban");
moban.style.display = "block"
var daoru = document.getElementById("daoru");
daoru.style.display = "block"
document.getElementById('all').value = 1
document.getElementById('part').value = 2
})
$("#all").click(function() {
var addtype = document.getElementById("addtype");
addtype.style.display = "none"
$("#part").attr('checked',false)
$("#all").attr('checked',true)
$("#excel").attr('checked',true)
$("#partchoose").attr('checked',false)
var moban = document.getElementById("moban");
moban.style.display = "none"
var daoru = document.getElementById("daoru");
daoru.style.display = "none"
document.getElementById("transfer_promote").style.display = "none"
document.getElementById("data_list").style.display = "none"
document.getElementById('all').value = 1
document.getElementById('part').value = 2
})
$("#excel").click(function() {
var moban = document.getElementById("moban");
// addtype.style.display = "none"
$("#excel").attr('checked',true)
$("#partchoose").attr('checked',false)
moban.style.display = "block"
var daoru = document.getElementById("daoru");
daoru.style.display = "block"
document.getElementById('transfer_promote').style.display = "none"
document.getElementById("data_list").style.display = "block"
})
$("#partchoose").click(function() {
var moban = document.getElementById("moban");
// addtype.style.display = "none"
$("#excel").attr('checked',false)
$("#partchoose").attr('checked',true)
moban.style.display = "none"
var daoru = document.getElementById("daoru");
daoru.style.display = "none"
document.getElementById('transfer_promote').style.display = "block"
document.getElementById("data_list").style.display = "none"
})
function addPromote() {
var addpromoteindex = document.getElementById("addpromoteindex");
var addpromote = document.getElementById("addpromote");
var promoteset = document.getElementById("promoteset");
addpromoteindex.style.display = "none"
addpromote.style.display = "none"
promoteset.style.display = "block"
document.getElementById('all').value = 1
document.getElementById('part').value = 2
}
function del(id) {
var msg = "确认删除该项?"
if(confirm(msg) == true) {
$.ajax({
url:"{:U('Game/delSociatyGames')}",
dataType:'json',
type:'POST',
data:{'id':id},
success:function(res) {
console.log(res.code)
if(res.code == 10001) {
window.location.reload();
}
}
})
}
}
function suba(game_id) {
var file_excel = $('#file_excel')[0].files[0]
var formData = new FormData();
formData.append("file",file_excel);
formData.append("game_id",game_id)
$.ajax({
url:"{:U('Game/uploadExcel1')}",
dataType:'json',
type:'POST',
async:false,
data:formData,
processData : false, // 使数据不做处理
contentType : false, // 不要设置Content-Type请求头
success:function(res) {
document.getElementById('data_list').style.display = "block"
res = JSON.parse(res)
var datalist = res.datalist
var outPromote = res.outPromote
if(datalist.length > 0) {
html = '<div class="" style="width:500px"><table><thead><tr><th>录入成功会长账号</th></tr></thead><tbody>'
datalist.forEach(v=>{
html += '<tr><td>'+v['account']+'</td></tr>';
})
}else {
html = '<div class="" style="width:500px"><table><thead><tr><th>录入成功会长账号</th></tr></thead><tbody>'
+'<tr><td colspan="14" class="text-center">aOh! 暂无账号录入!</td></tr>'
}
html += '</tbody></table></div>'
if(outPromote.length > 0) {
html += '<div class="" style="width:500px"><table><thead><tr><th>录入失败会长账号</th></tr></thead><tbody>'
outPromote.forEach(p=>{
html += '<tr><td>'+p['promote_account']+'</td></tr>';
})
}else {
html += '<div class="" style="width:500px"><table><thead><tr><th>录入失败会长账号</th></tr></thead><tbody>'
+'<tr><td colspan="14" class="text-center">aOh! 暂无录入失败会长账号!</td></tr>>'
}
html += '</tbody></table></div>'
$("#data_list").html(html);
}
})
}
$('[name=shift_mode]').on({
click: function () {
if ($(this).val() == 2) {
$('#shift-transfer').show()
} else {
$('#shift-transfer').hide()
}
}
})
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Game/lists')}');
@ -2366,4 +2643,10 @@
});
</script>
<style>
.layui-transfer-box{
overflow: hidden;
height: 410px!important;
}
</style>
</block>

@ -133,6 +133,7 @@
<th>工会类型</th>
<th>充值信息权限</th>
<th>申请时间</th>
<th>审核时间</th>
<th>备注</th>
<th>审核</th>
<th>申请人</th>
@ -243,6 +244,7 @@
<?php }?>
</td>
<td>{:set_show_time($data['applicant_time'])}</td>
<td>{:set_show_time($data['verify_time'])}</td>
<td>{$data['remark']}</td>
<td>
<?php if($data['verify_status'] == 0) {?>

@ -0,0 +1,916 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<style>
.tabcon1711 input.time {
width: 150px;
}
#form .txt_area1 {
width: 300px;
height: 150px;
}
.tabcon1711 .form_unit {
margin-left: 2px;
}
.tabcon1711 .mustmark {
margin-left:-7px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #000;
line-height: 30px;
}
.select2-container--default .select2-selection--single {
border-radius: 4px;
height: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 30px;
}
.tabcon1711 input[type=text]:read-only {
background: #CCCCCC;
}
.tabcon1711 .span-btn {
float: left;
margin-left: 30px;
height: 30px;
line-height: 30px;
color: #fff;
background-color: #3d96c8;
border: 0;
border-radius: 3px;
cursor: pointer;
align-content: center;
padding-left: 10px;
padding-right: 10px;
}
.tabcon1711 .edit-btn {
background-color: #3d96c8;
}
.tabcon1711 .cancel-btn {
background-color: #999;
display: none;
}
.tabcon1711 .edit-btn:hover {
background-color: #589dc8;
}
.tabcon1711 .cancel-btn {
background-color: #ababab;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<!-- <p class="description_text">说明:此功是创建推广员时所需填写信息</p>-->
</div>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('certification?model='.$model['id'])}" method="post" class="form-horizontal">
<!-- 基础文档模型 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">会长账号:</td>
<td class="r">
<input type="text" class="txt" disabled="disabled" style="background: #CCCCCC;" value="{$records['account']|default=''}">
<span class="notice-text">通过推广员后台注册申请或者管理后台创建的账号</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>真实姓名:</td>
<td class="r">
<empty name="records['real_name']">
<input type="text" class="txt" name="real_name" value="{$records['real_name']|default=''}">
<else/>
<input type="text" class="txt" name="real_name" value="{$records['real_name']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>身份证号码:</td>
<td class="r">
<empty name="records['real_name']">
<input type="text" class="txt" name="idcard" value="{$records['idcard']|default=''}">
<else/>
<input type="text" class="txt" name="idcard" value="{$records['idcard']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo"><i class="mustmark">*</i>身份证照:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="idcarpic" value="{$records['idcarpic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="idcarpic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="idcarpic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">请上传身份证正反面图片为jpg、png格式(不超过2M)</span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">营业执照:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="businesspic" value="{$records['businesspic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="businesspic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="businesspic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">如果是公司请上传营业执照</span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">合作合同:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="agreementpic" value="{$records['agreementpic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="agreementpic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="agreementpic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">须上传平台与贵公司(工作室)签署的合作合同</span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">补充认证:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="anothpic" value="{$records['anothpic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="anothpic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="anothpic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>电话:</td>
<td class="r">
<empty name="records['real_name']">
<input type="text" class="txt" name="mobile_phone" value="{$records['mobile_phone']|default=''}">
<else/>
<input type="text" class="txt" name="mobile_phone" value="{$records['mobile_phone']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>联系地址</td>
<td class="r1 table_select3">
<div class="info">
<div style="display: flex;">
<select id="s_province" name="s_province" class="select_gallery"></select>  
<select id="s_city" name="s_city" class="select_gallery" style="margin-left: 10px;"></select>  
<select id="s_county" name="s_county" class="select_gallery" style="margin-left: 10px;"></select>
<input type="text" class="txt" name="s_address" style="margin-left: 10px;width: 300px;" value="{$records['address'][1][0]|default=''}" placeholder="详细地址">
<script class="resources library" src="__STATIC__/provincecityarea/area1.js" type="text/javascript"></script>
<script type="text/javascript">
var pro ="{$records['address'][0]['0']|default=''}";
var city ="{$records['address'][0]['1']|default=''}";
var are ="{$records['address'][0]['2']|default=''}";
_init_area(pro, city, are);
</script>
</div>
<div id="show"></div>
</div>
<script type="text/javascript">
var showArea = function() {
$('#show').innerHTML = "<h3>省" + $('#s_province').value + " - 市" +
$('#s_city').value + " - 县/区" +
$('#s_county').value + "</h3>"
}
$('#s_county').attr('onchange', 'showArea()');
</script>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>邮箱:</td>
<td class="r">
<input type="text" class="txt" name="email" value="{$records['email']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>账户类型:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" value="1" name="account_type" <eq name="records['account_type']" value="1">checked="checked"</eq>>公司
</label >
<label>
<input type="radio" value="2" name="account_type" <eq name="records['account_type']" value="2">checked="checked"</eq>>个人
</label>
</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>开户银行:</td>
<td class="r">
<input type="text" class="txt" name="bank_name" value="{$records['bank_name']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>银行户名:</td>
<td class="r">
<input type="text" class="txt" name="bank_account" value="{$records['bank_account']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>银行账号:</td>
<td class="r">
<input type="text" class="txt" name="bank_card" value="{$records['bank_card']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
</div>
<input type="hidden" name="id" id="id" value="{$records['id']|default=''}" />
<div class="form-item cf">
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
审核
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</form>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Promote/lists/type/1">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('Promote/lists')}");
$(".select_gallery").select2();
$(function() {
showTab();
$('.edit-btn').click(function () {
var thisInput = $(this).prev();
thisInput.val('');
thisInput.removeAttr('readonly');
thisInput.focus();
$(this).hide();
$(this).next().show();
});
$('.cancel-btn').click(function () {
var thisInput = $(this).parent().children('input');
switch (thisInput.attr('name')) {
case 'real_name':
thisInput.val("{$records['real_name']}");
break;
case 'idcard':
thisInput.val("{$records['idcard']}");
break;
case 'mobile_phone':
thisInput.val("{$records['mobile_phone']}");
break;
}
thisInput.attr('readonly', 'readonly');
$(this).hide();
$(this).prev().show();
});
});
var userInfo = {userId:"kazaff", md5:"",icon:1}; //用户会话信息
</script>
<script>
var uploaderIdCarPic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPictureNotLimit', array('session_id'=>session_id(), 'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#idcarpic',
multiple:true
},
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:2,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgIdCarPicData = [];
var imgIdCarPicList = $("#idcarpic_thelist");
uploaderIdCarPic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imgIdCarPicList.append(html);
imgIdCarPicList.css('margin-top','10px');
var img2 = imgIdCarPicList.children('#'+file.id).find('img');
uploaderIdCarPic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img2.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderIdCarPic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderIdCarPic.on( 'uploadSuccess', function( file , response) {
imgIdCarPicData.push(Number(response.id));
setIconVal();
console.log(response)
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderIdCarPic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgIdCarPicData,function(index, item) {
if (response.id == item) {
imgIdCarPicData.splice(index,1);
return false;
}
});
setIconVal();
return false;
});
if (response.status == 1001) {
return false;
alert('图片大小不得超过2M');
$('#idcarpic_thelist').children().last().remove();
location.reload()
}
});
function setIconVal()
{
var icon = '';
$.each(imgIdCarPicData,function(index, item) {
icon += item + ',';
});
icon = icon.substring(0, icon.length - 1);
$('input[name=idcarpic]').val(icon);
}
<?php if (!empty($records['idcarpic_array'])) :?>
var html = '';
$('#idcarpic_thelist').css('margin-top','10px');
<?php foreach ($records['idcarpic_array'] as $value3) { ?>
<?php $value3 = (int)$value3; ?>
imgIdCarPicData.push(<?=$value3?>);
html += '<div id="' + <?=$value3?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value3,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value3?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#idcarpic_thelist').html(html);
$('#idcarpic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgIdCarPicData,function(index, item) {
if (thisId == item) {
imgIdCarPicData.splice(index,1);
return false;
}
});
setIconVal();
});
<?php endif ;?>
</script>
<script>
var uploaderImgbusinesspic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#businesspic',
multiple:true
},
// dnd: false,
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:5,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgListbusinesspicData = [];
var thisIndex1 = 0;
var imgbusinesspicList = $("#businesspic_thelist");
uploaderImgbusinesspic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imgbusinesspicList.append(html);
imgbusinesspicList.css('margin-top','10px');
var img1 = imgbusinesspicList.children('#'+file.id).find('img');
uploaderImgbusinesspic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img1.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderImgbusinesspic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderImgbusinesspic.on( 'uploadSuccess', function( file , response) {
imgListbusinesspicData.push(Number(response.id));
setbusinesspicVal();
console.log(response)
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderImgbusinesspic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgListbusinesspicData,function(index, item) {
if (response.id == item) {
imgListbusinesspicData.splice(index,1);
return false;
}
});
setbusinesspicVal();
return false;
});
});
function setbusinesspicVal()
{
var businesspic = '';
$.each(imgListbusinesspicData,function(index, item) {
businesspic += item + ',';
});
businesspic = businesspic.substring(0, businesspic.length - 1);
$('input[name=businesspic]').val(businesspic);
}
<?php if (!empty($records['businesspic_array'])) :?>
var html = '';
$('#businesspic_thelist').css('margin-top','10px');
<?php foreach ($records['businesspic_array'] as $value1) { ?>
<?php $value1 = (int)$value1; ?>
imgListbusinesspicData.push(<?=$value1?>);
html += '<div id="' + <?=$value1?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value1,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value1?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#businesspic_thelist').html(html);
$('#businesspic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgListbusinesspicData,function(index, item) {
if (thisId == item) {
imgListbusinesspicData.splice(index,1);
return false;
}
});
setbusinesspicVal();
});
<?php endif ;?>
</script>
<script>
var uploaderImgagreementpic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#agreementpic',
multiple:true
},
// dnd: false,
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:5,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgListagreementpicData = [];
var thisIndex1 = 0;
var imgagreementpicList = $("#agreementpic_thelist");
uploaderImgagreementpic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imgagreementpicList.append(html);
imgagreementpicList.css('margin-top','10px');
var img1 = imgagreementpicList.children('#'+file.id).find('img');
uploaderImgagreementpic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img1.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderImgagreementpic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderImgagreementpic.on( 'uploadSuccess', function( file , response) {
imgListagreementpicData.push(Number(response.id));
setagreementpicVal();
console.log(response);
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderImgagreementpic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgListagreementpicData,function(index, item) {
if (response.id == item) {
imgListagreementpicData.splice(index,1);
return false;
}
});
setagreementpicVal();
return false;
});
});
function setagreementpicVal()
{
var agreementpic = '';
$.each(imgListagreementpicData,function(index, item) {
agreementpic += item + ',';
});
agreementpic = agreementpic.substring(0, agreementpic.length - 1);
$('input[name=agreementpic]').val(agreementpic);
}
<?php if (!empty($records['agreementpic_array'])) :?>
var html = '';
$('#agreementpic_thelist').css('margin-top','10px');
<?php foreach ($records['agreementpic_array'] as $value1) { ?>
<?php $value1 = (int)$value1; ?>
imgListagreementpicData.push(<?=$value1?>);
html += '<div id="' + <?=$value1?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value1,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value1?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#agreementpic_thelist').html(html);
$('#agreementpic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgListagreementpicData,function(index, item) {
if (thisId == item) {
imgListagreementpicData.splice(index,1);
return false;
}
});
setagreementpicVal();
});
<?php endif ;?>
</script>
<script>
var uploaderImganothpic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#anothpic',
multiple:true
},
// dnd: false,
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:5,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgListanothpicData = [];
var thisIndex1 = 0;
var imganothpicList = $("#anothpic_thelist");
uploaderImganothpic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imganothpicList.append(html);
imganothpicList.css('margin-top','10px');
var img1 = imganothpicList.children('#'+file.id).find('img');
uploaderImganothpic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img1.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderImganothpic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderImganothpic.on( 'uploadSuccess', function( file , response) {
imgListanothpicData.push(Number(response.id));
setanothpicVal();
console.log(response);
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderImganothpic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgListanothpicData,function(index, item) {
if (response.id == item) {
imgListanothpicData.splice(index,1);
return false;
}
});
setanothpicVal();
return false;
});
});
function setanothpicVal()
{
var anothpic = '';
$.each(imgListanothpicData,function(index, item) {
anothpic += item + ',';
});
anothpic = anothpic.substring(0, anothpic.length - 1);
$('input[name=anothpic]').val(anothpic);
}
<?php if (!empty($records['anothpic_array'])) :?>
var html = '';
$('#anothpic_thelist').css('margin-top','10px');
<?php foreach ($records['anothpic_array'] as $value1) { ?>
<?php $value1 = (int)$value1; ?>
imgListanothpicData.push(<?=$value1?>);
html += '<div id="' + <?=$value1?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value1,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value1?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#anothpic_thelist').html(html);
$('#anothpic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgListanothpicData,function(index, item) {
if (thisId == item) {
imgListanothpicData.splice(index,1);
return false;
}
});
setanothpicVal();
});
<?php endif ;?>
</script>
</block>

@ -170,11 +170,11 @@
</php>
<tr>
<td>
<eq name="data.status" value="0">
<if condition="$data['status'] eq 0 or $data['status'] eq 1">
<input class="ids" type="checkbox" value="{$data['id']}" name="ids[]">
<else />
<else/>
<input class="ids disabled" disabled="disabled" type="checkbox" value="{$data['id']}" name="ids[]">
</eq>
</if>
</td>
<td>{$data.widthdraw_number}</td>
<td onclick="details('{$data["id"]}')"><span class="money_color">{$data.sum_money}</span></td>

@ -104,7 +104,7 @@
</if>
<notemtpy name = "data">
<volist name="data.statement_info" id="item">
<if condition="$item.statement_type eq 1">
<if condition="$item.statement_type eq 1 or $item.statement_type eq 2">
<tr>
<td >-</td>

@ -101,7 +101,7 @@
</if>
<notemtpy name = "data">
<volist name="data.statement_info" id="item">
<if condition="$item.statement_type eq 1">
<if condition="$item.statement_type eq 1 or $item.statement_type eq 2">
<tr>
<td >-</td>
@ -113,6 +113,7 @@
<td >-</td>
<td >{$item.sum_money}元</td>
</tr>
<else/>

@ -45,7 +45,10 @@ class PromoteRepository {
if (isset($params['sdk_version'])) {
$map['sdk_version'] = $params['sdk_version'];
}
if (isset($params['begin_time']) && isset($params['begin_time']) && isset($params['time_column'])) {
if (isset($params['role_level'])) {
$map['role_level'] = $params['role_level'];
}
if (isset($params['begin_time']) && isset($params['end_time']) && isset($params['time_column'])) {
$map[$params['time_column']] = ['between', [$params['begin_time'], $params['end_time']]];
}
if (isset($params['lock_status'])) {

@ -197,4 +197,30 @@ class ApplyService {
parse_str($items['query'], $params);
return $params;
}
public function checkSociatyPerm($promote, $game)
{
if ($game['apply_auth'] == 1) {
return true;
}
$promoteService = new PromoteService();
$topPromote = $promoteService->getTopPromote($promote);
$record = M('sociaty_games', 'tab_')->where(['game_id' => $game['id'], 'promote_id' => $topPromote['id']])->find();
if ($record['status'] == 1) {
return true;
} else {
return false;
}
}
public function getSociatyGameIds($promote)
{
$promoteService = new PromoteService();
$topPromote = $promoteService->getTopPromote($promote);
$tempIds = M('sociaty_games', 'tab_')->where(['promote_id' => $topPromote['id']])->getField('game_id', true);
$tempIds = $tempIds ?? [];
$ids = M('game', 'tab_')->where(['apply_auth' => 1])->getField('id', true);
$ids = $ids ?? [];
return array_merge($tempIds, $ids);
}
}

@ -1212,4 +1212,78 @@ function gameSearch($relationGameId, $sdkVersion)
$gameIds = $gameIds ?? [-1];
return $gameIds;
}
function convertAmountToCn($num) {
//判断$num是否存在
if(!$num) return '零圆';
//保留小数点后两位
$num = round($num, 2);
//将浮点转换为整数
$tem_num = $num * 100;
//判断数字长度
$tem_num_len = strlen($tem_num);
if($tem_num_len > 14) {
return '数值过大';
}
//大写数字
$dint = array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
//大写金额单位
$danwei = array('仟', '佰', '拾', '亿', '仟', '佰', '拾', '万', '仟', '佰', '拾', '圆');
$danwei1 = array('角', '分');
//空的变量用来保存转换字符串
$daxie = '';
//分割数字,区分圆角分
list($left_num, $right_num) = explode('.', $num);
//计算单位长度
$danwei_len = count($danwei);
//计算分割后的字符串长度
$left_num_len = strlen($left_num);
$right_num_len = strlen($right_num);
//循环计算亿万元等
for($i = 0; $i < $left_num_len; $i++) {
//循环单个文字
$key_ = substr($left_num, $i, 1);
//判断数字不等于0或数字等于0与金额单位为亿、万、圆就返回完整单位的字符串
if($key_ !== '0' || ($key_ == '0' && ($danwei[$danwei_len - $left_num_len + $i] == '亿' || $danwei[$danwei_len - $left_num_len + $i] == '万' || $danwei[$danwei_len - $left_num_len + $i] == '圆'))) {
$daxie = $daxie . $dint[$key_] . $danwei[$danwei_len - $left_num_len + $i];
} else {
//否则就不含单位
$daxie = $daxie . $dint[$key_];
}
}
//循环计算角分
for($i = 0; $i < $right_num_len; $i++) {
$key_ = substr($right_num, $i, 1);
if($key_ > 0) {
$daxie = $daxie . $dint[$key_] . $danwei1[$i];
}
}
//计算转换后的长度
$daxie_len = strlen($daxie);
//设置文字切片从0开始utf-8汉字占3个字符
$j = 0;
while($daxie_len > 0) {
//每次切片两个汉字
$str = substr($daxie, $j, 6);
//判断切片后的文字不等于零万、零圆、零亿、零零
if($str == '零万' || $str == '零圆' || $str == '零亿' || $str == '零零') {
//重新切片
$left = substr($daxie, 0, $j);
$right = substr($daxie, $j + 3);
$daxie = $left . $right;
}
$j += 3;
$daxie_len -= 3;
}
return $daxie . '整';
}

@ -66,11 +66,11 @@ class ApplyController extends BaseController
{
$loginPromote = $this->getLoginPromote();
$promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id');//搜索的渠道ID
$promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色
$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID
$grandPromoteId = getGrandPromoteId($promoteId);//本账号会长渠道ID
$childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限
$promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id'); //搜索的渠道ID
$promoteRole = empty(I('promote_role')) ? 1 : I('promote_role'); //渠道角色
$parentPromoteId = getParentPromoteId($promoteId); //上级渠道ID
$grandPromoteId = getGrandPromoteId($promoteId); //本账号会长渠道ID
$childGameAddPermission = getChildGameAddPermission($grandPromoteId); //游戏添加权限
$map['tab_game.online_status'] = 1;//开发者游戏上线状态
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
@ -92,6 +92,10 @@ class ApplyController extends BaseController
$map['tab_game.sdk_version'] = $type;
$applyService = new ApplyService();
$tempIds = $applyService->getSociatyGameIds($loginPromote);
$gameIdList = array_intersect($gameIdList, $tempIds);
if (count($gameIdList) > 0) {
$gameIds = implode(',', $gameIdList);
@ -115,9 +119,12 @@ class ApplyController extends BaseController
} else {
$gameIdList = M('Game', 'tab_')->group('relation_game_id')->having('count(id) = 2')->getField('id', true);
$applyService = new ApplyService();
$tempIds = $applyService->getSociatyGameIds($loginPromote);
$gameIdList = array_intersect($gameIdList, $tempIds);
if (count($gameIdList) > 0) {
$gameIds = implode(',', $gameIdList);
$map['tab_game.id'] = ['in', $gameIds];
} else {
$map = '1 = 2';

@ -1446,6 +1446,183 @@ class DownloadController extends BaseController {
$this->success('添加下载成功',U('listsIndex'));
}
/*推广员指标查看详情 */
public function quotaDtl_data_export() {
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
$relationGameId = I('relation_game_id', 0);
$sdkVersion = I('sdk_version', 0);
$serverId = I('server_id', 0);
$roleLevelBegin = intval(I('level_begin', 0));
$roleLevelEnd = intval(I('level_end', 0));
$promoteId = I('promote_id', 0);
$isSelf = I('is_self', 0);
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
}
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
$map['role_level'] = ['elt', $roleLevelEnd];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) {
$map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]];
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['create_time'] = ['between', [$beginTime, $endTime]];
if ($promoteId) {
if ($isSelf) {
$map['promote_id'] = $promoteId;
} else {
$promote = M('promote', 'tab_')->field(['id', 'chain'])->where(array('id' => $promoteId))->find();
$promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"];
$promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
} else {
$map = '1 = 2';
}
// $data = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select();
$conditions = json_encode($map,TRUE);
$addtime = time();
$data1 = [
'logid' => 'quotadtl_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/promoteQuota',
'dataname' => '推广员详情',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data1);
if (!$res) {
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
/*推广指标首页导出*/
public function promoteQuota_data_export() {
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
if (!empty($time)) {
$defaultTime = $time;
}
$sdkVersion = I('sdk_version', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$levelBegin = I('level_begin', '');
$levelEnd = I('level_end', '');
$prevParentId = 0;
$promoteService = new PromoteService();
$loginPromote = $this->getLoginPromote();
$parent = null;
if ($parentId > 0) {
$parent = M('promote', 'tab_')->where(['id' => $parentId])->find();
$currentDisplay = $promoteService->getLevelName($parent['level']) . '推广';
$prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id'];
} else {
$parent = $loginPromote;
$currentDisplay = '自己';
}
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$data = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map)->select();
$ids = array_column($data, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
}
}
$map = [
'isContainSubs' => true,
'basicPromotes' => json_encode($basicPromotes,FALSE),
];
$map['promotes'] = json_encode($data,FALSE);
$map['parentsinfo'] = json_encode($parent,FALSE);;
$map['currentDisplay'] = $currentDisplay;
$map['ids'] = $ids;
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$map['server_id'] = $serverId;
}
$where = $map;
if ($sdkVersion != 0) {
$map['sdk_version'] = $sdkVersion;
}
if ($levelBegin !== '' || $levelEnd !== '') {
if ($levelBegin !== '' && $levelEnd !== '') {
$levelBegin = intval($levelBegin);
$levelEnd = intval($levelEnd);
if ($levelBegin > $levelEnd) {
$this->error('角色等级范围错误');
}
$map['role_level'] = ['between', [$levelBegin, $levelEnd]];
} elseif ($levelBegin !== '' && $levelEnd === '') {
$levelBegin = intval($levelBegin);
$map['role_level'] = ['egt', $levelBegin];
} elseif ($levelBegin === '' && $levelEnd !== '') {
$levelEnd = intval($levelEnd);
$map['role_level'] = ['elt', $levelEnd];
}
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['begin_time'] = $beginTime;
$map['end_time'] = $endTime;
$conditions = json_encode($map,TRUE);
$addtime = time();
$data1 = [
'logid' => 'quota_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/promoteQuota',
'dataname' => '推广员指标',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data1);
if (!$res) {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
public function achievement_data_export() {
$time = I('time', date('Y-m-d'));
@ -1863,15 +2040,142 @@ class DownloadController extends BaseController {
case "平台币充值":
$this->orderlistExcelInfo($id,$map);
break;
case "玩家行为日志";
case "玩家行为日志":
$this->playactionExcelInfo($id,$map);
break;
case "推广员指标":
$this->promotequotaExcelInfo($id,$map);
break;
case "推广员详情":
$this->promotequotaDtlExcelInfo($id,$map);
break;
default:
break;
}
}
public function promotequotaDtlExcelInfo($id,$map) {
$xlsName = "推广员详情";
$xlsCell = array(
array('user_account','玩家账号'),
array('promote_account','推广账号'),
array('game_name','游戏名称'),
array('sdk_version','平台'),
array('server_name','游戏区服'),
array('role_name','角色名'),
array('role_level','等级'),
array('create_time','创建时间'),
);
$records = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select();
foreach ($records as $key => $value) {
//订单隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
if($value1['sdk_version'] == 1) {
$value1['sdk_version'] = "安卓版";
}
if($value1['sdk_version'] == 2) {
$value1['sdk_version'] = "苹果版";
}
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
}
public function promotequotaExcelInfo($tid,$map) {
$xlsName = "推广员指标";
$xlsCell = array(
array('account','账号'),
array('real_name','姓名'),
array('game_name','游戏名称'),
array('sdk_version_text','平台'),
array('server_name','游戏区服'),
array('role_num','角色数量'),
);
$params['isContainSubs'] = $map['isContainSubs'];
$params['basicPromotes'] = json_decode($map['basicPromotes'],TRUE);
$ids = $map['ids'];
$promotes = json_decode($map["promotes"],TRUE);
if(!empty($map['game_id'])) {
$params['game_id'] = $map["game_id"];
}
if(!empty($map['server_id'])) {
$params['server_id'] = $map["server_id"];
}
if(!empty($map['sdk_version'])) {
$params['sdk_version'] = $map["sdk_version"];
}
if(!empty($map['role_level'])) {
$params['role_level'] = $map['role_level'];
unset($map['role_level']);
}
if(!empty($map['parentsinfo'])) {
$parent = json_decode($map['parentsinfo'],TRUE);
unset($map['parentsinfo']);
}
// if(!empty($map['currentDisplay'])) {
// $currentDisplay = $map['currentDisplay'];
// unset($map['currentDisplay']);
// }
$params['begin_time'] = $map['begin_time'];
$params['end_time'] = $map['end_time'];
//var_dump($params);
$records = [];
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$game = $this->getgame($map);
$record = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
'level' => $parent['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $selfCreateRoleCountList[$parent['id']],
'current_display' => $currentDisplay,
];
$records[] = $record;
foreach ($promotes as $promote) {
$id = $promote['id'];
$record = [
'id' => $id,
'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
'level' => $promote['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $createRoleCountList[$id],
'current_display' => '',
];
$records[] = $record;
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
$value1['account'] = $this->encryption($value1['account']);
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$tid);
}
public function playactionExcelInfo($id,$map) {
$xlsName = "玩家行为日志";
$xlsCell = array(
@ -3716,6 +4020,55 @@ class DownloadController extends BaseController {
return substr($string, 0, $strLen) . $hideChar . substr($string, $orderLen-$strLen);
}
private function getGame($map = [])
{
$gameName = '全部游戏';
$sdkVersionText = getSDKTypeName(0, true);
$serverName = '--';
if (isset($map['game_id']) || isset($map['sdk_version'])) {
$where = [];
if (!isset($map['game_id'])) {
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
} elseif (!isset($map['sdk_version'])) {
$where['id'] = $map['game_id'];
$gameName = M('game', 'tab_')->where($where)->getField('relation_game_name');
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], 0, $map['server_id']);
}
} else {
$where['id'] = $map['game_id'];
$where['sdk_version'] = $map['sdk_version'];
$gameName = M('game', 'tab_')->where($where)->getField('game_name');
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], $map['sdk_version'], $map['server_id']);
}
}
}
$game = [
'game_name' => $gameName,
'sdk_version_text' => $sdkVersionText,
'server_name' => $serverName,
];
return $game;
}
private function getServerName($gameIds, $serverVersion, $serverId)
{
$map['_string'] = '1 = 1';
if ($gameIds) {
$map['game_id'] = $gameIds;
}
if ($serverVersion) {
$map['server_version'] = $serverVersion;
}
if ($serverId) {
$map['server_id'] = $serverId;
}
return M('server', 'tab_')->where($map)->getField('server_name');
}
}

@ -119,7 +119,8 @@ class FinanceController extends BaseController
$income = $model->field("sum(if(pay_time < $thisDay, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as history_income,
sum(if(pay_time >= $thisMonth, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as this_month_income,
sum(if((pay_time >= $yesterday and pay_time < $thisDay), if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as yesterday_income,
sum(if(pay_time < $thisDay, if(selle_status = 0, pay_amount * selle_ratio, 0), 0)) as balance")
sum(if(pay_time < $thisDay, if(selle_status = 0, pay_amount * selle_ratio, 0), 0)) as balance,
sum(if(selle_status = 0, pay_amount, 0)) as not_withdrawn_amount")
->where($map)
->find();
@ -127,10 +128,41 @@ class FinanceController extends BaseController
$value = bcdiv($value, 100, 2);
}
$withdrawMap['promote_id'] = $this->loginPromote['id'];
$withdrawMap['status'] = ['neq', 2];
//已提现总额
$income['withdrawn_amount'] = M('withdraw', 'tab_')->field('sum(sum_money) as withdrawn_amount')->where($withdrawMap)->find()['withdrawn_amount'];
$withdrawns = M('withdraw', 'tab_')->field('settlement_begin_time, settlement_end_time')
->where($withdrawMap)
->select();
$days = [];
if (!empty($withdrawns)) {
foreach ($withdrawns as $withdrawn) {
$thisDays = [];
if (empty($withdrawn['settlement_begin_time'])) {
if ($begTime < $withdrawn['settlement_end_time']) {
if ($endTime <= $withdrawn['settlement_end_time']) {
$thisEndTime = $endTime;
} else {
$thisEndTime = $withdrawn['settlement_end_time'];
}
$thisDays = $this->getDayList($begTime, $thisEndTime);
}
} else {
$thisDays = $this->getDayList($withdrawn['settlement_begin_time'], $withdrawn['settlement_end_time']);
}
$days = array_merge($days, $thisDays);
}
}
$days = array_unique($days);
$map['pay_time'] = ['between', [$begTime, $endTime]];
$dayList = $this->getDayList($begTime, $endTime);
$data = $model->field('FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,
sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as income')
sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as income, selle_status')
->where($map)
->group('day')
->select();
@ -140,13 +172,16 @@ class FinanceController extends BaseController
$records[] = [
'day' => $date,
'income' => bcdiv($data[$day], 100, 2),
'selle_status_text' => (in_array($day, $days) ? '已提现' : '未提现'),
'url' => U('settlementDtl', array('begtime' => $day, 'endtime' => $day))
];
}
}
$settlementCycle = ($this->loginPromote['settlement_type'] == 1 ? '周结' : '月结');
$this->assign('income', $income);
$this->assign('listData', $records);
$this->assign('settlementCycle', $settlementCycle);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('yesterday', date('Y-m-d', $yesterday));
@ -625,45 +660,25 @@ class FinanceController extends BaseController
$this->error('参数异常');
}
$settlementBeginTime = $withdraw['settlement_begin_time'];
$settlementEndTime = $withdraw['settlement_end_time'];
$withdraw['create_time'] = date('Y-m-d H:i:s', $withdraw['create_time']);
$withdraw['settlement_end_time'] = date('Y-m-d H:i:s', $withdraw['settlement_end_time']);
$withdraw['status'] = FinanceController::$withdrawStatus[$withdraw['status']];
if (empty($withdraw['game_ratio'])) {
$map['_string'] = '1 = 2';
} else {
$gameRatios = json_decode($withdraw['game_ratio'], true);
$gameIds = array_keys($gameRatios);
$map['game_id'] = ['in', $gameIds];
$map['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
}
if ($withdraw['settlement_type'] != 3) {
$map['withdraw_id'] = $withdrawId;
}
$data = M('spend', 'tab_')
->field('game_id,game_name,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income')
->where($map)
->group('game_id')
->order('game_id')
->select();
if (!empty($data)) {
foreach ($data as &$list) {
$list['income'] = '0.00';
if (isset($gameRatios[$list['game_id']])) {
foreach ($gameRatios[$list['game_id']] as $gameIncome) {
$income = bcdiv(bcmul($gameIncome['sum_amount'], $gameIncome['selle_ratio'], 2), 100, 2);
$list['income'] = bcadd($list['income'], $income, 2);
}
}
}
}
$this->assign('withdraw', $withdraw);
$this->assign('listData', $data);
$this->assign('promoteData', $this->loginPromote);
$statementMap['ext_field'] = $withdraw['widthdraw_number'];
$statementMap['statement_type'] = 1;
$statement = M('statement', 'tab_')->where($statementMap)->find();
if (empty($statement)) {
$this->error('未生成下游结算单');
}
$statement['first_party_info'] = json_decode($statement['first_party_info'], 1);//甲方
$statement['second_party_info'] = json_decode($statement['second_party_info'], 1);//乙方
$statement['statement_info'] = json_decode($statement['statement_info'], 1);//结算记录
//收款方
$statement['receive_company'] = ($statement['pay_type'] ? $statement['first_party_info']['partner'] : $statement['second_party_info']['partner']);
$all_sum_money = array_sum(array_column($statement['statement_info'], 'sum_money'));//合计平台总额
$all_pay_amount = array_sum(array_column($statement['statement_info'], 'pay_amount'));//合计结算金额
$big_all_sum_money = convertAmountToCn($statement['statement_money']);//大写
$this->assign('big_all_sum_money', $big_all_sum_money);
$this->assign('all_sum_money', $all_sum_money);
$this->assign('all_pay_amount', $all_pay_amount);
$this->assign('data', $statement);
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->display();

@ -154,8 +154,8 @@ class HomeController extends Controller
$this->error('该链接已被禁');
}
$applyService = new ApplyService();
if ($code != '') {
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
if (!$result['status']) {
@ -173,6 +173,7 @@ class HomeController extends Controller
$columns = [
'id',
'sdk_version',
'apply_auth',
'icon',
'screenshot',
'relation_game_id',
@ -193,6 +194,11 @@ class HomeController extends Controller
$map = ['id' => intval($gameId)];
$game = M('game', 'tab_')->field($columns)->where($map)->find();
$promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find();
if (!$applyService->checkSociatyPerm($promote, $game)) {
$this->error('该链接已经停止使用');
}
if ($game['sdk_version'] == 1 && $isIOS) {
$map = [];
$map['relation_game_id'] = $game['relation_game_id'];
@ -207,6 +213,9 @@ class HomeController extends Controller
$apply = M('apply', 'tab_')->field(['game_id', 'enable_status', 'promote_id'])
->where(['promote_id' => $promoteId, 'game_id' => $game['id']])
->find();
if (!$apply) {
$this->error('该链接已经停止使用');
}
$game['icon'] = get_cover($game['icon'], 'path');
$gameSource = M('GameSource', 'tab_')->field(['create_time', 'org_plist_url', 'is_new_sdk'])->where(array('game_id' => $game['id']))->find();

@ -40,8 +40,9 @@ class PackageController extends Controller
if ($isBlack) {
$this->redirect("package/downloadError", ['message' => '该链接已被禁']);
}
$applyService = new ApplyService();
if ($code != '') {
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD);
if (!$result['status']) {
@ -59,7 +60,16 @@ class PackageController extends Controller
$map['promote_id'] = $promoteId;
$columns = ['game_id', 'promote_id', 'promote_account', 'pack_url', 'plist_url', 'status', 'enable_status'];
$apply = M('apply','tab_')->field($columns)->where($map)->find();
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version'])->where(['id' => $apply['game_id']])->find();
if (!$apply) {
$this->redirect("package/downloadError", ['message' => '该链接已经停止使用']);
}
$promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find();
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find();
if (!$applyService->checkSociatyPerm($promote, $game)) {
$this->redirect("package/downloadError", ['message' => '该链接已经停止使用']);
}
if (Request::isMobile()) {
if (!Request::isAndroid() && $game['sdk_version'] == 1) {

@ -2209,4 +2209,272 @@ class QueryController extends BaseController
$this->ajaxReturn($data);
}
//推广员指标管理
public function promoteQuota()
{
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
if (!empty($time)) {
$defaultTime = $time;
}
$sdkVersion = I('sdk_version', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$levelBegin = I('level_begin', '');
$levelEnd = I('level_end', '');
$prevParentId = 0;
$promoteService = new PromoteService();
$loginPromote = $this->getLoginPromote();
$parent = null;
if ($parentId > 0) {
$parent = M('promote', 'tab_')->where(['id' => $parentId])->find();
$currentDisplay = $promoteService->getLevelName($parent['level']) . '推广';
$prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id'];
} else {
$parent = $loginPromote;
$currentDisplay = '自己';
}
$searchLevel = $parent['level'] + 1;
$searchLevelName = $promoteService->getLevelName($searchLevel);
$games = get_promote_serach_game();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select();
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
}
}
$params = [
'isContainSubs' => true,
'basicPromotes' => $basicPromotes,
];
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$params['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
$where = $params;
if ($sdkVersion != 0) {
$where['sdk_version'] = $sdkVersion;
}
$game = $this->getGame($where);
if ($levelBegin !== '' || $levelEnd !== '') {
if ($levelBegin !== '' && $levelEnd !== '') {
$levelBegin = intval($levelBegin);
$levelEnd = intval($levelEnd);
if ($levelBegin > $levelEnd) {
$this->error('角色等级范围错误');
}
$params['role_level'] = ['between', [$levelBegin, $levelEnd]];
} elseif ($levelBegin !== '' && $levelEnd === '') {
$levelBegin = intval($levelBegin);
$params['role_level'] = ['egt', $levelBegin];
} elseif ($levelBegin === '' && $levelEnd !== '') {
$levelEnd = intval($levelEnd);
$params['role_level'] = ['elt', $levelEnd];
}
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$params['begin_time'] = $beginTime;
$params['end_time'] = $endTime;
$records = [];
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
if (I('p', 1) == 1) {
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$record = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
'level' => $parent['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $selfCreateRoleCountList[$parent['id']],
'current_display' => $currentDisplay,
];
$records[] = $record;
}
foreach ($promotes as $promote) {
$id = $promote['id'];
$record = [
'id' => $id,
'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
'level' => $promote['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $createRoleCountList[$id],
'current_display' => '',
];
$records[] = $record;
}
$this->assign('prevParentId', $prevParentId);
$this->assign('searchLevelName', $searchLevelName);
$this->assign('games', $games);
$this->assign('parent', $parent);
$this->assign('subPromotes', $subPromotes);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('parentId', $parentId);
$this->assign('count', $count);
$this->assign('time', $defaultTime);
$this->assign('meta_title', '推广员指标');
$this->display();
}
public function quotaDtl()
{
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
$relationGameId = I('relation_game_id', 0);
$sdkVersion = I('sdk_version', 0);
$serverId = I('server_id', 0);
$roleLevelBegin = intval(I('level_begin', 0));
$roleLevelEnd = intval(I('level_end', 0));
$promoteId = I('promote_id', 0);
$isSelf = I('is_self', 0);
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
}
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
$map['role_level'] = ['elt', $roleLevelEnd];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) {
$map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]];
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['create_time'] = ['between', [$beginTime, $endTime]];
if ($promoteId) {
if ($isSelf) {
$map['promote_id'] = $promoteId;
} else {
$promote = M('promote', 'tab_')->field(['id', 'chain'])->where(array('id' => $promoteId))->find();
$promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"];
$promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
} else {
$map = '1 = 2';
}
$query = M('user_play_info', 'tab_')->where($map)->order('create_time desc');
list($records, $pagination, $count) = $this->paginate($query);
foreach ($records as $key => $value) {
//订单隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) {
$strLen = 2;
}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
}
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('count', $count);
$this->display();
}
private function getGame($map = [])
{
$gameName = '全部游戏';
$sdkVersionText = getSDKTypeName(0, true);
$serverName = '--';
if (isset($map['game_id']) || isset($map['sdk_version'])) {
$where = [];
if (!isset($map['game_id'])) {
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
} elseif (!isset($map['sdk_version'])) {
$where['id'] = $map['game_id'];
$gameName = M('game', 'tab_')->where($where)->getField('relation_game_name');
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], 0, $map['server_id']);
}
} else {
$where['id'] = $map['game_id'];
$where['sdk_version'] = $map['sdk_version'];
$gameName = M('game', 'tab_')->where($where)->getField('game_name');
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], $map['sdk_version'], $map['server_id']);
}
}
}
$game = [
'game_name' => $gameName,
'sdk_version_text' => $sdkVersionText,
'server_name' => $serverName,
];
return $game;
}
private function getServerName($gameIds, $serverVersion, $serverId)
{
$map['_string'] = '1 = 1';
if ($gameIds) {
$map['game_id'] = $gameIds;
}
if ($serverVersion) {
$map['server_version'] = $serverVersion;
}
if ($serverId) {
$map['server_id'] = $serverId;
}
return M('server', 'tab_')->where($map)->getField('server_name');
}
}

@ -33,6 +33,11 @@
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>昨日收益</p><span>¥{$income.yesterday_income}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>账户余额</p><span>¥{$income.balance}</span></div> </li>
</ul>
<ul style="margin-top: 10px;">
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>已提现总金额</p><span>¥{$income.withdrawn_amount}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>未提现金额</p><span>¥{$income.not_withdrawn_amount}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>结算周期</p><span>{$settlementCycle}</span></div> </li>
</ul>
</div>
<div style="margin-top: 2.4vh;">
<!-- <button class="withdraw" id="withdraw">提现</button>-->
@ -61,6 +66,7 @@
<tr class="odd">
<th>时间</th>
<th>收益</th>
<th>提现状态</th>
<th>操作</th>
</tr>
<empty name="listData">
@ -70,6 +76,7 @@
<tr>
<td>{$data.day}</td>
<td>{$data.income}</td>
<td>{$data.selle_status_text}</td>
<td><a href="{$data.url}">明细</a></td>
</tr>
</volist>

@ -52,80 +52,68 @@
<div class="trunk-content article">
<div class="trunk-search clearfix" style="display: grid;">
<div class="tab detailed-box">
<label class="detailed-title detailed-label">提现订单号:</label>
<label class="detailed-title detailed-label">乙方:</label>
<div class="detailed-content-box">
<span>{$withdraw.widthdraw_number}</span>
<span>{$data['second_party_info']['partner']}</span>
</div>
<label class="detailed-title detailed-label">申请时间:</label>
<label class="detailed-title detailed-label">户名:</label>
<div class="detailed-content-box">
<span>{$withdraw.create_time}</span>
<span>{$data['second_party_info']['bank_account_name']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">会长账号:</label>
<label class="detailed-title detailed-label">提现单号:</label>
<div class="detailed-content-box">
<span>{$withdraw.promote_account}</span>
<span>{$data['ext_field']}</span>
</div>
<label class="detailed-title detailed-label">结算截止时间:</label>
<label class="detailed-title detailed-label">银行账号:</label>
<div class="detailed-content-box">
<span>{$withdraw.settlement_end_time}</span>
<span>{$data['second_party_info']['bank_account']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">状态:</label>
<label class="detailed-title detailed-label">订单类型:</label>
<div class="detailed-content-box">
<span>{$withdraw.status}</span>
<span>{$data['second_party_info']['settlement_type']}</span>
</div>
<label class="detailed-title detailed-label">收款人:</label>
<label class="detailed-title detailed-label">开户行:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_account}</span>
<span>{$data['second_party_info']['opening_bank']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">开户行:</label>
<label class="detailed-title detailed-label">联系人:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_name}</span>
<span>{$data['second_party_info']['link_man']}</span>
</div>
<label class="detailed-title detailed-label">银行账号:</label>
<label class="detailed-title detailed-label">邮寄地址:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_card}</span>
<span>{$data['second_party_info']['address']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">收益金额:</label>
<label class="detailed-title detailed-label">联系电话:</label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
</span>
<span>{$data['second_party_info']['link_phone']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">奖惩金额:</label>
<label class="detailed-title detailed-label">开票项目:</label>
<div class="detailed-content-box">
<span>0.00</span>
<span>{$data['second_party_info']['invoice_item']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">实际提现金额:</label>
<label class="detailed-title detailed-label"></label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
<span style="color: red;">(实际提现金额=收益金额+奖惩金额)</span>
</span>
<span></span>
</div>
<label class="detailed-title detailed-label">发票类型:</label>
<div class="detailed-content-box">
<span>{$data['second_party_info']['invoice_type']}</span>
</div>
</div>
</div>
@ -136,19 +124,20 @@
</div>
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table">
<table class="table normal_table" style="border: 1px solid #ddd;">
<tr class="odd">
<th>游戏名称</th>
<th>流水</th>
<th>现金分成基数</th>
<!-- <th>现金分成比例</th>-->
<th>平台币分成基数</th>
<!-- <th>平台币分成比例</th>-->
<th>绑定币分成基数</th>
<!-- <th>绑定币分成比例</th>-->
<th>合作方分成金额</th>
<th>结算时间</th>
<th >产品</th>
<th >平台总额</th>
<if condition = "$data.second_party_info.settlement_type eq '补点订单'">
<th >补点比例</th>
<else/>
<th >分成比例</th>
</if>
<th >税费费率</th>
<th >结算金额(元)</th>
</tr>
<if condition="true eq empty($listData) or $withdraw.status eq -1">
<if condition="true eq empty($data)">
<tr class="num2">
<td colspan="99" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
@ -156,36 +145,73 @@
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.game_name}</td>
<td>{$vo.pay_amount_all}</td>
<if condition="$vo.pay_way neq -1 and $vo.pay_way neq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<!-- <td>{$vo.selle_ratio}%</td>-->
<td>{$vo.income}</td>
</tr>
<volist name="data.statement_info" id="item">
<if condition="$item.statement_type eq 1">
<tr>
<td >-</td>
<td >{$item.type_name}</td>
<td >{$item.sum_money}</td>
<td >-</td>
<td >-</td>
<td >{$item.sum_money}</td>
</tr>
<else/>
<tr>
<td >{$item.statement_begin_time}-{$item.statement_end_time}</td>
<td >{$item.game_name}</td>
<td >{$item.pay_amount}</td>
<td >{$item.second_ratio}%</td>
<td >{$item.fax_ratio}%</td>
<td >{$item.sum_money}</td>
</tr>
</if>
</volist>
<tr>
<td><span>总计</span></td>
<td><span>-</span></td>
<td ><span><if condition="$data.pay_amount neq ''">{$data.pay_amount}<else/>0</if></span></td>
<td>-</td>
<td>-</td>
<td><if condition="$data.statement_money neq ''">{$data.statement_money}<else/>0</if></td>
</tr>
<tr>
<td><span>本月分成总金额(人民币大写)</span></td>
<td>-</td>
<td >-</td>
<td>-</td>
<td>-</td>
<td><if condition="$big_all_sum_money neq ''">{$big_all_sum_money}<else/></if></td>
</tr>
</if>
</table>
</div>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix" style="display: grid;">
<div class="tab detailed-box">
<label class="detailed-title detailed-label">甲方:</label>
<div class="detailed-content-box">
<span>{$data['first_party_info']['jfCompany']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">联系人:</label>
<div class="detailed-content-box">
<span>{$data['first_party_info']['jfPerson']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">联系电话:</label>
<div class="detailed-content-box">
<span>{$data['first_party_info']['jfTel']}</span>
</div>
</div>
</div>
</div>
<div class="detailed-br"></div>
</div>
</block>

@ -197,7 +197,7 @@
<td>
<a href="{:U('withdrawDtl', array('id'=>$vo['id']))}">提现明细</a>
<if condition="$vo['status'] eq 2">
<a data-href="{:U('download/Remittancecer',['id'=>$vo['id']])}" class="ajax-get">汇款证明</a>
<!-- <a data-href="{:U('download/Remittancecer',['id'=>$vo['id']])}" class="ajax-get">汇款证明</a>-->
<elseif condition="$vo['status'] eq -1"/>
<!-- <span class="renew-review" data-id="{$vo['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>-->
</if>

@ -192,7 +192,6 @@
<th>游戏类型</th>
<th>平台</th>
<th>混服情况</th>
<th>玩家折扣</th>
<th>分成比例</th>
</tr>
<empty name="dataList">
@ -210,7 +209,6 @@
<td>{$vo.game_type_name}</td>
<td>{:getSDKTypeName($vo['sdk_version'])}</td>
<td><?=($vo['server_type']==1)?'专服':'混服'?></td>
<td><?=($vo['discount']==10)?'----':($vo['discount'].'折')?></td>
<td>{$vo.ratio}%</td>
</tr>
</volist>

@ -72,6 +72,7 @@
<a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>
<?php endif;?>
<a href="{:U('Query/achievement')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq achievement '>active</if> ">团队/推广员业绩</a>
<a href="{:U('Query/promoteQuota')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq promoteQuota or ACTION_NAME eq quotaDtl) '>active</if> ">推广员指标</a>
</div>
<?php endif;?>

@ -0,0 +1,189 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.btn-span {
color: #06c;
cursor: pointer;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>{$meta_title}</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">{$meta_title}</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/promoteQuota',['row'=>I('get.row')])}" method="post" enctype="multipart/form-data">
<input type="hidden" name="parent_id" value="{:I('parent_id', 0)}">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择{$searchLevelName}</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}({$promote.real_name})</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="game-select" name="relation_game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.relation_game_id}" <if condition="I('relation_game_id') eq $game['relation_game_id']">selected</if>>{$game.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="sdk_version" name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}" >
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space fr">
<input type="text" class="txt range-date" name="time" placeholder="创角时间" value="{$time}" >
</div>
<div class="form-group normal_space fr">
<label>角色等级:</label>
<input type="text" class="txt float-input" name="level_begin" style="width: 50px" value="{:I('level_begin')}" >
<label> ~ </label>
<input type="text" class="txt float-input" name="level_end" style="width: 50px" value="{:I('level_end')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
</div>
<?php if ($prevParentId > 0):?>
<div class="form-group">
<a class="submit normal_space" href="{:U('Query/promoteQuota', ['row'=>I('get.row'), 'parent_id' => $prevParentId,'time'=>$time])}" style="line-height: 36px; display: inline-block; text-align: center; background: #E5E5E5; color: #2bd8ed; cursor: pointer;">返回上级</a>
</div>
<?php endif;?>
</form>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>推广员</th>
<th>游戏名称</th>
<th>平台</th>
<th>游戏区服</th>
<th>角色数量</th>
<th>操作</th>
</tr>
<empty name="records">
<tr><td colspan="14" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="records" id="record" mod="2">
<tr data-id="{$vo.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.account}({$record.real_name})
<?php if($record['current_display'] != ''):?>
<span style="color: #06C;">[{$record['current_display']}]</span>
<?php endif;?>
</td>
<td>{$record.game_name}</td>
<td>{$record.sdk_version_text}</td>
<td>{$record.server_name}</td>
<td>{$record.role_num}</td>
<td>
<?php if($record['current_display'] == '' && $record['level'] < 4):?>
<a href="{:U('Query/promoteQuota', ['parent_id' => $record['id'], 'time' => $time])}">查看下级</a>
<?php endif;?>
<?php if($record['current_display'] != ''):?>
<a href="{:U('Query/quotaDtl', ['parent_id' => I('parent_id', 0), 'time' => $time, 'promote_id' => $record['id'], 'relation_game_id' => I('relation_game_id', ''), 'sdk_version' => I('sdk_version', ''), 'server_id' => I('server_id', ''), 'level_begin' => I('level_begin', ''), 'level_end' => I('level_end', ''), 'is_self' => 1])}">查看详情</a>
<?php else :?>
<a href="{:U('Query/quotaDtl', ['parent_id' => I('parent_id', 0), 'time' => $time, 'promote_id' => $record['id'], 'relation_game_id' => I('relation_game_id', ''), 'sdk_version' => I('sdk_version', ''), 'server_id' => I('server_id', ''), 'level_begin' => I('level_begin', ''), 'level_end' => I('level_end', ''), 'is_self' => 0])}">查看详情</a>
<?php endif;?>
</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" href="{:U('download/promoteQuota_data_export',array_merge(['parent_id'=>$parentId,'time'=>$time],I('post.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<eq name='timeout' value='1'>
<script>
layer.msg('时间间隔不能超过7天');
</script>
</eq>
<script type="text/javascript">
$(function() {
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId, sdk_version: sdkVersion},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
})
</script>
</block>

@ -0,0 +1,100 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" rel="stylesheet">
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div style="position: absolute;margin-top: -25px;color: #6a7082;">
<span class="back-btn" style="cursor: pointer;"><i class="iconfont iconreply"></i> 返回</span>
</div>
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>推广员指标></span><span>查看详情</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">查看详情</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>玩家帐号</th>
<th>推广账号</th>
<th>游戏名称</th>
<th>平台</th>
<th>游戏区服</th>
<th>角色名</th>
<th>等级</th>
<th>创建时间</th>
</tr>
<empty name="records">
<tr><td colspan="8" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="records" id="record" mod="2">
<tr data-id="{$vo.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.user_account}</td>
<td>{$record.promote_account}</td>
<td>{$record.game_name}</td>
<td>{:getSDKTypeName($record['sdk_version'])}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.role_level}</td>
<td>
<?php if($record['create_time'] == 0):?>
{$record.play_time|date='Y-m-d H:i:s',###}
<?php else:?>
{$record.create_time|date='Y-m-d H:i:s',###}
<?php endif;?>
</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/quotaDtl_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
$('.back-btn').on('click', function () {
location.href = "{:U('Query/promoteQuota', ['parent_id' => I('parent_id'), 'time' => $time])}";
});
})
</script>
</block>

@ -1074,6 +1074,22 @@ CREATE TABLE `sys_document_pop_rules` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--广--
CREATE TABLE `tab_sociaty_games` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`promote_id` int(11) NOT NULL COMMENT '会长ID',
`game_id` int(11) NOT NULL COMMENT '游戏ID',
`status` tinyint(1) NOT null DEFAULT '0' COMMENT '状态 0 禁用 1 启用',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT '工会授权游戏';
----
ALTER TABLE `tab_game`
ADD COLUMN `apply_auth` INT(11) NULL DEFAULT '1' COMMENT '申请权限(1为全部可申请2为部分会长可申请)' AFTER `game_detail_cover`;
-- 2020-01-14
-- cxj
ALTER TABLE `tab_promote_game_ratio`

Loading…
Cancel
Save