From d843adba4ef6dcc0b60e5b410b31948eda2cb091 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 11 Oct 2019 11:27:15 +0800 Subject: [PATCH 1/2] Data/update.sql --- Data/update.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Data/update.sql b/Data/update.sql index 649b3c39b..80f0dcd62 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -67,12 +67,17 @@ alter table tab_game_source add column `org_plist_url` varchar(255) NOT NULL def -- 2019-10-08 cxj -- ---------------------------- ALTER TABLE `tab_game` ADD COLUMN `server_type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '1-专服 2-混服' AFTER `support_ratio`; +ALTER TABLE `tab_game` ADD COLUMN `detail_content` MEDIUMTEXT NULL DEFAULT NULL COMMENT '游戏资料介绍' AFTER `features`; -- ---------------------------- -- 2019-10-10 cxj -- ---------------------------- ALTER TABLE `tab_promote` ADD COLUMN `child_game_permission` tinyint(2) NOT NULL DEFAULT 0 COMMENT '下级游戏添加权限 0-本账号已添加游戏 1-所有游戏' AFTER `idcard`; --- 2019-10-11 cxj -ALTER TABLE `tab_apply` ADD COLUMN `bale_sort` int(5) NOT NULL DEFAULT 0 COMMENT '打包顺序' AFTER `offline_status`; +-- ---------------------------- +-- 2019-10-11 zyx +-- ---------------------------- +ALTER TABLE `tab_support` ADD COLUMN `freeze` tinyint(2) NOT NULL DEFAULT 1 COMMENT '0-冻结 1-启用' AFTER `notice_status`; +-- 2019-10-11 cxj +ALTER TABLE `tab_apply` ADD COLUMN `bale_sort` int(5) NOT NULL DEFAULT 0 COMMENT '打包顺序' AFTER `offline_status`; \ No newline at end of file From fe331aebad2d3776b4c6fce6558c5289b00867b1 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 11 Oct 2019 14:29:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0->=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B1=87=E6=80=BB=20=E6=AF=8F=E6=97=A5=E6=A6=82=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 5b06ee2a3..80c8e6599 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -958,7 +958,7 @@ class QueryController extends BaseController $allData['spend_voucher'] = 0; foreach ($data as &$list) { $thisDateTime = strtotime($list['day']); - $userPlayInfoWhere['tab_user_play_info.play_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]]; + $userPlayInfoWhere['tab_user_play_info.create_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]]; $userGameLoginWhere['tab_user_game_login_record.login_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]]; $spendWhere['tab_spend.pay_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]]; @@ -976,7 +976,7 @@ class QueryController extends BaseController ->group('tab_user_play_info.user_id') ->select());//创角用户 - $newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $thisDateTime . $newWhere . ') as old_num'; + $newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $thisDateTime . $newWhere . ') as old_num'; $list['new_user_num'] = count($userPlayInfoModel ->field($newUserSql) ->join($join) @@ -985,15 +985,24 @@ class QueryController extends BaseController ->group('tab_user_play_info.user_id') ->having('old_num = 0') ->select());//新创角用户 - $list['new_device_num'] = 0;//新创角设备 - $newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.play_ip = tab_user_play_info.play_ip and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $thisDateTime . $newWhere . ') as old_num'; + $newDeviceSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_device_number = tab_user_play_info.create_device_number and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $thisDateTime . $newWhere . ') as old_num'; + $list['new_device_num'] = count($userPlayInfoModel + ->field($newDeviceSql) + ->join($join) + ->where($userPlayInfoWhere) + ->where($map) + ->group('tab_user_play_info.create_device_number') + ->having('old_num = 0') + ->select());//新创角设备 + + $newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_ip = tab_user_play_info.create_ip and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $thisDateTime . $newWhere . ') as old_num'; $list['new_ip_num'] = count($userPlayInfoModel ->field($newIpSql) ->join($join) ->where($userPlayInfoWhere) ->where($map) - ->group('tab_user_play_info.play_ip') + ->group('tab_user_play_info.create_ip') ->having('old_num = 0') ->fetchSql(true) ->select());//新增创角IP @@ -1215,7 +1224,7 @@ class QueryController extends BaseController $newWhere = ''; $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); - $userPlayInfoWhere['tab_user_play_info.play_time'] = ['between', [$begTime, $endTime + 86399]]; + $userPlayInfoWhere['tab_user_play_info.create_time'] = ['between', [$begTime, $endTime + 86399]]; $userGameLoginWhere['tab_user_game_login_record.login_time'] = ['between', [$begTime, $endTime + 86399]]; $spendWhere['tab_spend.pay_time'] = ['between', [$begTime, $endTime + 86399]]; $spendWhere['tab_spend.pay_status'] = 1; @@ -1238,7 +1247,7 @@ class QueryController extends BaseController ->group('tab_user_play_info.user_id') ->select());//创角用户 - $newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $begTime . $newWhere . ') as old_num'; + $newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $begTime . $newWhere . ') as old_num'; $list['new_user_num'] = count($userPlayInfoModel ->field($newUserSql) ->where($userPlayInfoWhere) @@ -1246,13 +1255,19 @@ class QueryController extends BaseController ->having('old_num = 0') ->select());//新创角用户 - $list['new_device_num'] = 0;//新创角设备 + $newDeviceSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_device_number = tab_user_play_info.create_device_number and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $begTime . $newWhere . ') as old_num'; + $list['new_device_num'] = count($userPlayInfoModel + ->field($newDeviceSql) + ->where($userPlayInfoWhere) + ->group('tab_user_play_info.create_device_number') + ->having('old_num = 0') + ->select());//新创角设备 - $newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.play_ip = tab_user_play_info.play_ip and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $begTime . $newWhere . ') as old_num'; + $newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_ip = tab_user_play_info.create_ip and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $begTime . $newWhere . ') as old_num'; $list['new_ip_num'] = count($userPlayInfoModel ->field($newIpSql) ->where($userPlayInfoWhere) - ->group('tab_user_play_info.play_ip') + ->group('tab_user_play_info.create_ip') ->having('old_num = 0') ->fetchSql(true) ->select());//新增创角IP