|
|
@ -1806,22 +1806,15 @@ class QueryController extends BaseController
|
|
|
|
$map['s.promote_id'] = $queryPromote['id'];
|
|
|
|
$map['s.promote_id'] = $queryPromote['id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$subMap['create_time'] = ['between', [$begTime, $endTime - 1]];
|
|
|
|
$having = '1 = 1';
|
|
|
|
if ($costBegin != '' || $costEnd != '') {
|
|
|
|
if ($costBegin != '' || $costEnd != '') {
|
|
|
|
$having = '';
|
|
|
|
|
|
|
|
if ($costBegin != '' && $costEnd != '') {
|
|
|
|
if ($costBegin != '' && $costEnd != '') {
|
|
|
|
$having = 'sum(recharge_cost) between ' . $costBegin . ' and ' . $costEnd;
|
|
|
|
$having = 'recharge_cost between ' . $costBegin . ' and ' . $costEnd;
|
|
|
|
} elseif ($costBegin != '' && $costEnd == '') {
|
|
|
|
} elseif ($costBegin != '' && $costEnd == '') {
|
|
|
|
$having = 'sum(recharge_cost) >= ' . $costBegin;
|
|
|
|
$having = 'recharge_cost >= ' . $costBegin;
|
|
|
|
} elseif ($costBegin == '' && $costEnd != '') {
|
|
|
|
} elseif ($costBegin == '' && $costEnd != '') {
|
|
|
|
$having = 'sum(recharge_cost) <= ' . $costEnd;
|
|
|
|
$having = 'recharge_cost <= ' . $costEnd;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$subQuery = M('user_play_data_count', 'tab_')->field('role_id')
|
|
|
|
|
|
|
|
->where($subMap)
|
|
|
|
|
|
|
|
->group('game_id, server_id, role_id')
|
|
|
|
|
|
|
|
->having($having)
|
|
|
|
|
|
|
|
->buildSql();
|
|
|
|
|
|
|
|
$map['_string'] = 's.game_player_id in(' . $subQuery . ')';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$orderBy = 'login_time desc';
|
|
|
|
$orderBy = 'login_time desc';
|
|
|
@ -1871,6 +1864,7 @@ class QueryController extends BaseController
|
|
|
|
->join('join tab_user as u on u.id = s.user_id')
|
|
|
|
->join('join tab_user as u on u.id = s.user_id')
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->group('s.game_player_id, s.server_id, s.game_id')
|
|
|
|
->group('s.game_player_id, s.server_id, s.game_id')
|
|
|
|
|
|
|
|
->having($having)
|
|
|
|
->buildSql();
|
|
|
|
->buildSql();
|
|
|
|
$query = M()->alias('record')
|
|
|
|
$query = M()->alias('record')
|
|
|
|
->table($subQuery)
|
|
|
|
->table($subQuery)
|
|
|
|