推广平台>数据管理>充值玩家--更新

master
chenxiaojun 5 years ago
parent f032257838
commit 0f3038ea18

@ -1782,16 +1782,13 @@ class QueryController extends BaseController
$ids[] = $queryPromote['id']; $ids[] = $queryPromote['id'];
$map = ['uc.promote_id' => ['in', $ids]]; $map = ['uc.promote_id' => ['in', $ids]];
$subMap = ['promote_id' => ['in', $ids]];
if ($relationGameId != 0 || $sdkVersion != 0) { if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion); $gameIds = gameSearch($relationGameId, $sdkVersion);
$map['uc.game_id'] = ['in', $gameIds]; $map['uc.game_id'] = ['in', $gameIds];
$subMap['game_id'] = ['in', $gameIds];
} }
if ($serverId != 0) { if ($serverId != 0) {
$map['uc.server_id'] = $serverId; $map['uc.server_id'] = $serverId;
$subMap['server_id'] = $serverId;
} }
if ($roleName != '') { if ($roleName != '') {
$map['ui.role_name'] = ['like', $roleName . '%']; $map['ui.role_name'] = ['like', $roleName . '%'];
@ -1857,9 +1854,9 @@ class QueryController extends BaseController
$field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count'; $field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count';
$subQuery = M('user_play_data_count', 'tab_')->alias('uc') $subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field) ->field($field)
->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.role_id = uc.role_id') ->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->where($map) ->where($map)
->group('uc.role_id,uc.game_id,uc.user_id') ->group('uc.role_id,uc.server_id,uc.game_id')
->buildSql(); ->buildSql();
$query = M()->alias('record') $query = M()->alias('record')
->table($subQuery) ->table($subQuery)
@ -1867,15 +1864,10 @@ class QueryController extends BaseController
list($records, $pagination, $count) = $this->paginate($query); list($records, $pagination, $count) = $this->paginate($query);
$totalQuery = M('user_play_data_count', 'tab_')->alias('uc') $total = M('user_play_data_count', 'tab_')->alias('uc')
->field($fieldUC) ->field($fieldUC)
->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and uc.server_id = ui.server_id and ui.role_id = uc.role_id') ->join('left join tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->group('uc.role_id,uc.game_id,uc.server_id,uc.user_id')
->where($map) ->where($map)
->buildSql();
$total = M()->alias('totals')
->table($totalQuery)
->field('sum(recharge_cost) recharge_cost,sum(recharge_count) recharge_count,sum(recharge_cost_today) as recharge_cost_today')
->find(); ->find();
foreach ($records as &$list) { foreach ($records as &$list) {
@ -1944,7 +1936,7 @@ class QueryController extends BaseController
public function getSubPromotes() public function getSubPromotes()
{ {
$promoteId = I('promote_id', 0); $promoteId = I('promote_id', 0) ?: -1;
$promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promoteId])->select(); $promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promoteId])->select();
$this->ajaxReturn([ $this->ajaxReturn([
'status' => 1, 'status' => 1,

Loading…
Cancel
Save