diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index f59133f0b..03ccdcd0c 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1806,22 +1806,15 @@ class QueryController extends BaseController $map['s.promote_id'] = $queryPromote['id']; } - $subMap['create_time'] = ['between', [$begTime, $endTime - 1]]; + $having = '1 = 1'; if ($costBegin != '' || $costEnd != '') { - $having = ''; if ($costBegin != '' && $costEnd != '') { - $having = 'sum(recharge_cost) between ' . $costBegin . ' and ' . $costEnd; + $having = 'recharge_cost between ' . $costBegin . ' and ' . $costEnd; } elseif ($costBegin != '' && $costEnd == '') { - $having = 'sum(recharge_cost) >= ' . $costBegin; + $having = 'recharge_cost >= ' . $costBegin; } 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'; @@ -1871,6 +1864,7 @@ class QueryController extends BaseController ->join('join tab_user as u on u.id = s.user_id') ->where($map) ->group('s.game_player_id, s.server_id, s.game_id') + ->having($having) ->buildSql(); $query = M()->alias('record') ->table($subQuery)