master
chenxiaojun 5 years ago
commit b27e7e3854

@ -789,7 +789,7 @@ class MemberController extends ThinkController
} }
// $map['type'] = 1; // $map['type'] = 1;
// $map['login_time'] = ['exp', 'login_time<>0']; // $map['login_time'] = ['exp', 'login_time<>0'];
$map['login_time'] = ['gt',0]; // $map['login_time'] = ['gt',0];
$extend = array(); $extend = array();
$extend['map'] = $map; $extend['map'] = $map;

@ -22,6 +22,7 @@ class PromoteCoinController extends ThinkController
$extend['source_id'] = 0; $extend['source_id'] = 0;
$map = $extend; $map = $extend;
} else { } else {
$extend['type'] = 1;
$extend['promote_id'] = $_GET['promote_id']; $extend['promote_id'] = $_GET['promote_id'];
$extend['promote_type'] = $_GET['promote_type']; $extend['promote_type'] = $_GET['promote_type'];

@ -69,25 +69,39 @@ unset($_REQUEST['parent_id']);
$this->m_title = '推广员列表'; $this->m_title = '推广员列表';
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Promote/lists/type/1','status'=>1])->find()); $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Promote/lists/type/1','status'=>1])->find());
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
if(!empty(I('oa_associated')) || !is_null(I('oa_associated'))) {
$map['oa_associated'] = I('oa_associated');
$oa_data = [];
for($i = 1; $i > 0; $i++) {
$arr['time'] = time();
$arr['page'] = $i;
$arr['pageSize'] = 1000;
ksort($arr);
reset($arr);
$sign = md5(http_build_query($arr) . 'wmkjtx_kj213');
$arr['sign'] = $sign;
$re_data = curl_post('http://oa.76ba.com/api/wanmeng/platformAccount',$arr);
$re_data = json_decode($re_data,true);
if($re_data['code'] == 1) {
$oa = $re_data['data'];
$oa_data = array_merge($oa_data,$oa);
} else {
break;
}
}
$promote = D(self::model_name)->field('id,account')->where(['oa_associated' => 0])->order('id DESC')->select();
$oa_data = array_column($oa_data, 'platform_account');
foreach($promote as $k => $v) {
if(in_array($v['account'], $oa_data)) {
M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => 1]);
}
}
}
$list_data = D(self::model_name)->where($map)->order('id DESC')->page($p,$row)->select(); $list_data = D(self::model_name)->where($map)->order('id DESC')->page($p,$row)->select();
// $arr['time'] = time();
// $arr['page'] = 1;
// $arr['pageSize'] = 1000;
// ksort($arr);
// reset($arr);
// $sign = md5(http_build_query($arr) . 'wmkjtx_kj213');
// $arr['sign'] = $sign;
// $reData = curl_post('http://oa.76ba.com/api/wanmeng/platformAccount',$arr);
// $reData = json_decode($reData,true)['data'];
// $oa = array_column($reData, 'platform_account');
// foreach($list_data as $k => $v)
// {
// if($v['oa_associated'] != 1) {
// $oa_val = in_array($v['account'], $oa) ? 1 : 0;
// $list_data[$k]['oa_associated'] = $oa_val;
// M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => $oa_val]);
// }
// }
$oa_data = []; $oa_data = [];
foreach($list_data as $k => $v) foreach($list_data as $k => $v)
{ {
@ -103,18 +117,18 @@ unset($_REQUEST['parent_id']);
reset($arr); reset($arr);
$sign = md5(http_build_query($arr) . 'wmkjtx_kj213'); $sign = md5(http_build_query($arr) . 'wmkjtx_kj213');
$arr['sign'] = $sign; $arr['sign'] = $sign;
$reData = curl_post('http://oa.76ba.com/api/wanmeng/verifyBind',$arr); $re_data = curl_post('http://oa.76ba.com/api/wanmeng/verifyBind',$arr);
$reData = json_decode($reData,true)['data']; $re_data = json_decode($re_data,true)['data'];
foreach($list_data as $k => $v) foreach($list_data as $k => $v)
{ {
if(in_array($v['account'], $reData)) if(in_array($v['account'], $re_data))
{ {
$list_data[$k]['oa_associated'] = $reData[$v['account']]; $list_data[$k]['oa_associated'] = $re_data[$v['account']];
M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => $reData[$v['account']]]); M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => $re_data[$v['account']]]);
} }
} }
} }
$count = D(self::model_name)->count(); $count = (I('oa_associated') || !is_null(I('oa_associated') )) ? D(self::model_name)->where($map)->count() : D(self::model_name)->count();
$page = set_pagination($count,$row); $page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);} if($page) {$this->assign('_page', $page);}
$this->assign('list_data', $list_data); $this->assign('list_data', $list_data);

@ -105,7 +105,7 @@ class RechargeSumController extends ThinkController
} }
$count = count($data); $count = count($data);
$export_data = $data;
$page = set_pagination($count, $row); $page = set_pagination($count, $row);
if ($page) { if ($page) {
$this->assign('_page', $page); $this->assign('_page', $page);
@ -122,7 +122,7 @@ class RechargeSumController extends ThinkController
//判断是否执行导出 //判断是否执行导出
if (I('export') == 1) { if (I('export') == 1) {
$this->exportSum($data); $this->exportSum($export_data);
} }
$this->assign('meta_title', "充值汇总"); $this->assign('meta_title', "充值汇总");
$this->assign('list_data', $data); $this->assign('list_data', $data);

@ -38,8 +38,8 @@ class GameModel extends Model{
array('support_quota', '/^[0-9]*$/', '请输入正确的扶持额度', self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH), array('support_quota', '/^[0-9]*$/', '请输入正确的扶持额度', self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH),
array('game_score', '/^(\d(\.\d)?|10)$/', '游戏评分输入格式不正确', self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH), array('game_score', '/^(\d(\.\d)?|10)$/', '游戏评分输入格式不正确', self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH),
array('recommend_level', '/^(\d(\.\d)?|10)$/', '推荐指数输入格式不正确', self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH), array('recommend_level', '/^(\d(\.\d)?|10)$/', '推荐指数输入格式不正确', self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH),
array('discount',[1,10],'代充折扣错误', self::MUST_VALIDATE, 'between', self::MODEL_BOTH), // array('discount',[1,10],'代充折扣错误', self::MUST_VALIDATE, 'between', self::MODEL_BOTH),
array('bind_recharge_discount',[1,10],'绑币充值折扣错误',self::MUST_VALIDATE, 'between', self::MODEL_BOTH), // array('bind_recharge_discount',[1,10],'绑币充值折扣错误',self::MUST_VALIDATE, 'between', self::MODEL_BOTH),
array('dratio','/^(((\d|[1-9]\d)(\.\d{1,2})?)|100|100.0|100.00)$/','开发者分成比例错误',self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH), array('dratio','/^(((\d|[1-9]\d)(\.\d{1,2})?)|100|100.0|100.00)$/','开发者分成比例错误',self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH),
array('support_ratio','/^100$|^(\d|[1-9]\d)$/','请输入正确的扶持比例',self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH), array('support_ratio','/^100$|^(\d|[1-9]\d)$/','请输入正确的扶持比例',self::VALUE_VALIDATE, 'regex', self::MODEL_BOTH),

@ -328,12 +328,12 @@ $(document).ready(function () {
function initSelect2WithSearch() { function initSelect2WithSearch() {
$("#sel_order").select2({ // $("#sel_order").select2({
tags: true, // tags: true,
placeholder: '订单状态', // placeholder: '订单状态',
allowClear: false, //清空 // allowClear: false, //清空
minimumResultsForSearch: Infinity, // 永久隐藏搜索框 // minimumResultsForSearch: Infinity, // 永久隐藏搜索框
}); // });
} }
</script> </script>
</block> </block>

@ -127,6 +127,13 @@
<option value="4">修改审核中</option> <option value="4">修改审核中</option>
</select> </select>
</div> </div>
<div class="input-list input-list-channelstatus">
<select name="oa_associated">
<option value="">oa关联</option>
<option value="1">已关联</option>
<option value="0">未关联</option>
</select>
</div>
<else/> <else/>
<div class="input-list input-list-channelstatus"> <div class="input-list input-list-channelstatus">
<select name="url_type"> <select name="url_type">
@ -142,6 +149,13 @@
<option value="2">未审核</option> <option value="2">未审核</option>
</select> </select>
</div> </div>
<div class="input-list input-list-channelstatus">
<select name="oa_associated">
<option value="">oa关联</option>
<option value="1">已关联</option>
<option value="0">未关联</option>
</select>
</div>
</empty> </empty>
<input type="hidden" name="" value="" class="sortBy"> <input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}"> <input type="hidden" name="type" value="{$_GET['type']}">

@ -66,23 +66,23 @@
</select> </select>
</div> --> </div> -->
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" > <select id="game_name" name="game_name" class="select_gallery" >
<option value="">设备类型</option> <option value="">游戏名称</option>
<option value="1">安卓</option> <volist name=":getAllGame()" id="vo">
<option value="2">苹果</option> <option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select> </select>
</div> </div>
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" > <select id="game_type" name="game_type" class="select_gallery" >
<option value="">游戏名称</option> <option value="">设备类型</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo"> <option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option> <option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</volist> -->
</select> </select>
</div> </div>
<div class="input-list input-list-server search_label_rehab"> <div class="input-list input-list-server search_label_rehab">
<select id="server_id" name="server_id" class="select_gallery" style="width:120px;"> <select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">请选择区服</option> <option value="">区服名称</option>
</select> </select>
</div> </div>
<div class="input-list search_item input-list-gamenoticestatus"> <div class="input-list search_item input-list-gamenoticestatus">

@ -1289,25 +1289,12 @@ class DownloadController extends BaseController {
$levelPromote = $this->getLevelPromote(); $levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote); $queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [ $map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true); $ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if(empty($ids)) { $ids[] = $queryPromote['id'];
$ids = array();
}
if(empty($levelPromote)) {
array_push($ids,PID);
}
// array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['promote_id'] = ['in',$ids];
}else { $map = ['promote_id' => ['in', $ids]];
$map['_string'] = '1<>1'; $subMap = ['promote_id' => ['in', $ids]];
}
if ($gameId != 0) { if ($gameId != 0) {
$gameMap['relation_game_id'] = $gameId; $gameMap['relation_game_id'] = $gameId;
@ -1315,7 +1302,9 @@ class DownloadController extends BaseController {
$gameMap['sdk_version'] = $sdkVersion; $gameMap['sdk_version'] = $sdkVersion;
} }
$gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true);
$map['game_id'] = ['in', $gameId1]; $map['game_id'] = ['in', $gameId1];
$subMap['game_id'] = ['in', $gameId1];
} }
if ($serverId != 0) { if ($serverId != 0) {
$map['server_id'] = $serverId; $map['server_id'] = $serverId;
@ -2816,21 +2805,33 @@ class DownloadController extends BaseController {
$subMap = []; $subMap = [];
if(!empty($map['game_id'])) { if(!empty($map['game_id'])) {
$subMap['game_id'] = $map['game_id']; $subMap['game_id'] = $map['game_id'];
$map['uc.game_id'] = $map['game_id'];
unset($map['game_id']);
} }
if(!empty($map['server_id'])) { if(!empty($map['server_id'])) {
$subMap['server_id'] = $map['server_id']; $subMap['server_id'] = $map['server_id'];
$map['ui.server_id'] = $map['server_id'];
unset($map['server_id']);
}
if(!empty($map['role_name'])) {
$map['ui.role_name'] = $map['role_name'];
unset($map['role_name']);
}
if(!empty($map['user_account'])) {
$map['ui.user_account'] = $map['user_account'];
unset($map['user_account']);
}
if(!empty($map['promote_id'])) {
$map['uc.promote_id'] = $map['promote_id'];
unset($map['promote_id']);
} }
$costBegin = $map['costbegin']; $costBegin = $map['costbegin'];
$costEnd = $map['costend']; $costEnd = $map['costend'];
unset($map['costbegin']); unset($map['costbegin']);
unset($map['costend']); unset($map['costend']);
$nowTime = strtotime(date('Y-m-d 00:00:00', time()));
$subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; $subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$roleIdMap = $subMap;
$roleIds = M('user_play_data_count', 'tab_')->where($roleIdMap)->group('role_id')->getField('role_id', true);
if (count($roleIds) > 0) {
$map['role_id'] = ['in', $roleIds];
}
if ($costBegin != '' || $costEnd != '') { if ($costBegin != '' || $costEnd != '') {
$having = ''; $having = '';
if ($costBegin != '' && $costEnd != '') { if ($costBegin != '' && $costEnd != '') {
@ -2845,40 +2846,24 @@ class DownloadController extends BaseController {
->group('game_id,server_id,role_id') ->group('game_id,server_id,role_id')
->having($having) ->having($having)
->buildSql(); ->buildSql();
$map['_string'] = 'role_id in (' . $subQuery . ')'; $map['_string'] = 'ui.role_id in (' . $subQuery . ')';
} }
$spendMap['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; $map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
// $map['create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')) - 6*24*3600, strtotime(date('Y-m-d 23:59:59'))]];
$sqlCost = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc.recharge_cost) cost')
->where($spendMap)
->buildSql();
$sqlCount = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc.recharge_count) count')
->where($spendMap)
->buildSql();
$spendMap['uc.create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
$sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc.recharge_count) count')
->where($spendMap)
->buildSql();
unset($map['begintime']); unset($map['begintime']);
unset($map['endtime']); unset($map['endtime']);
$subQuery = M('user_play_info', 'tab_') //$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
->field("*,$sqlCost as recharge_cost,$sqlCount as recharge_count,$sqlTodayCost as recharge_cost_today") $fieldUC = "sum(uc.recharge_cost) recharge_cost,sum(uc.recharge_count) recharge_count,sum(if(uc.create_time = {$nowTime},uc.recharge_cost,0)) as recharge_cost_today";
->where($map) $fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version";
->having('recharge_cost > 0') $field = $fieldUC . ',' . $fieldUI;
->order('play_time desc') $subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->buildSql(); ->field($field)
$roles = M()->field(' * ') ->join('tab_user_play_info as ui on ui.promote_id = uc.promote_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->table($subQuery) ->where($map)
->alias('a') ->group('uc.role_id,uc.server_id,uc.game_id')
->order('play_time desc') ->buildSql();
->select(); $roles = M()->alias('record')
->table($subQuery)
->select();
foreach ($roles as $role) { foreach ($roles as $role) {
$records[] = [ $records[] = [
'user_account' => encryption($role['user_account']), 'user_account' => encryption($role['user_account']),

Loading…
Cancel
Save