From 60fff33fca2130261b72868238ab33268c13de66 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 17 Dec 2019 17:22:45 +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 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 66b79687d..7b1c4b9ba 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1114,6 +1114,7 @@ class QueryController extends BaseController $summaryData = []; $dayList = $this->getDayList($begTime, $endTime); + $dayListReverse = $dayList; $dayList = array_reverse($dayList); $params['dayList'] = $dayList; @@ -1185,7 +1186,9 @@ class QueryController extends BaseController $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); - + } + foreach ($dayListReverse as $day) { + $date = date('Ymd', strtotime($day)); $summaryData['date'][] = $date; $summaryData['role_num'][] = $roleNumList[$day]; $summaryData['user_num'][] = $userNumList[$day]; @@ -1865,10 +1868,15 @@ class QueryController extends BaseController list($records, $pagination, $count) = $this->paginate($query); - $total = M('user_play_data_count', 'tab_')->alias('uc') + $totalQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($fieldUC) - ->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') + ->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') ->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(); foreach ($records as &$list) {