From ee095e306857c6af70aeb31a7ec83087782e76a0 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 25 Nov 2019 20:29:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=AE=A1=E7=90=86->=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 4 ++-- Data/update.sql | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index a81251bfc..dfda7397a 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1785,7 +1785,7 @@ class QueryController extends BaseController $map['_string'] = 'ui.role_id in(' . $subQuery . ')'; } - $orderBy = 'ui.play_time desc'; + $orderBy = 'play_time desc'; if (!empty($sortName)) { if (in_array($sortName, $sortNameData)) { $desc = ' desc'; @@ -1814,7 +1814,7 @@ class QueryController extends BaseController $field = $fieldUC . ',' . $fieldUI; $subQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($field) - ->join('tab_user_play_info as ui on ui.promote_id = uc.promote_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->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') ->where($map) ->group('uc.role_id,uc.server_id,uc.game_id') ->buildSql(); diff --git a/Data/update.sql b/Data/update.sql index f247c096c..024e18c0e 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -559,3 +559,7 @@ ADD COLUMN `promote_id` int(11) NOT NULL DEFAULT 0 COMMENT '推广员ID'; ALTER TABLE `tab_user_play_data_count` DROP INDEX `search`, ADD INDEX `search`(`user_id`, `promote_id`, `game_id`, `server_id`, `role_id`, `create_time`) USING BTREE; + +--玩家角色表--添加索引 +ALTER TABLE `tab_user_play_info` +ADD INDEX `game_id`(`game_id`, `server_id`, `role_id`); \ No newline at end of file From 1966e0a2e812b549e67907f7b59f226dd5071b66 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Mon, 25 Nov 2019 20:31:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/MemberController.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 36fd51598..a20bc258a 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -124,8 +124,10 @@ class MemberController extends ThinkController } $game_map = ""; - - $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + if (!empty($_REQUEST['game_name']) || !empty($_REQUEST['game_type'])) { + $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + } + $spendprom .= " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")"; if (isset($_REQUEST['server_name'])) { $spendprom .= " and ss.server_name like '{$_REQUEST['server_name']}%' "; From 96bf61ada02612e2eb0d62639083b93f01f9e1f9 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Mon, 25 Nov 2019 20:36:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=86=B2=E5=80=BC=E7=8E=A9=E5=AE=B6promote?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 281cdee41..07e77e5e9 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2857,7 +2857,7 @@ class DownloadController extends BaseController { $field = $fieldUC . ',' . $fieldUI; $subQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($field) - ->join('tab_user_play_info as ui on ui.promote_id = uc.promote_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->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') ->where($map) ->group('uc.role_id,uc.server_id,uc.game_id') ->buildSql();