From 03edc87f4fb68298eb5bd304d0cb573e4acb6e44 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 16 Dec 2019 17:33:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86>=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E6=A3=80=E7=B4=A2bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index dcdf36f6b..06e4a4e6c 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1879,6 +1879,7 @@ class QueryController extends BaseController ->order($orderBy); $total = M('user_play_data_count', 'tab_')->alias('uc') ->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 ui.role_id = uc.role_id') ->where($map) ->find(); From dc2c4ee6529e20603a926fedb51bf7723411dcdd Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 16 Dec 2019 17:50:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86>=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E6=A3=80=E7=B4=A2bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 06e4a4e6c..9af3fa9a9 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1877,14 +1877,20 @@ class QueryController extends BaseController $query = M()->alias('record') ->table($subQuery) ->order($orderBy); - $total = M('user_play_data_count', 'tab_')->alias('uc') + + list($records, $pagination, $count) = $this->paginate($query); + + $totalQuery = M('user_play_data_count', 'tab_')->alias('uc') ->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 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 uc.server_id = ui.server_id and ui.role_id = uc.role_id') + ->group('uc.role_id,uc.game_id,uc.server_id,uc.user_id,uc.id') ->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(); - list($records, $pagination, $count) = $this->paginate($query); - foreach ($records as &$list) { if (empty($list['user_account']) ) { $list['user_account'] = M('user', 'tab_')->where("id = {$list['user_id']}")->getField('account');