From 7709163e03ca2d8e5d4f310a9056851530747ce6 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 20 Dec 2019 13:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=AE=A1=E7=90=86>=E5=85=85=E5=80=BC=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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)