From 27665e5b14dbf8eca763c39271954e12cc8e194e Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 24 Oct 2019 20:22:17 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB|=E6=AF=8F=E6=97=A5?= =?UTF-8?q?=E6=A6=82=E5=86=B5->bug=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 | 52 ++++++++++++++----- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index d593ace66..a2a242e79 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1036,12 +1036,14 @@ class QueryController extends BaseController $childPromoteIds = getAllChildPromoteList(3); if (empty($childPromoteIds)) { $userPlayInfoWhere['tab_user_play_info.promote_id'] = PID; + $userPlayInfoWhere2['ti.promote_id'] = PID; $userGameLoginWhere['tab_user_game_login_record.promote_id'] = PID; $spendWhere['tab_spend.promote_id'] = PID; } else { $childPromoteIds .= ',' . PID; $userPlayInfoWhere['tab_user_play_info.promote_id'] = ['in', $childPromoteIds]; + $userPlayInfoWhere2['ti.promote_id'] = ['in', $childPromoteIds]; $userGameLoginWhere['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds]; $spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds]; } @@ -1056,12 +1058,14 @@ class QueryController extends BaseController $childPromoteIds = getAllChildPromoteList(3, $teamLeaderId); if (empty($childPromoteIds)) { $userPlayInfoWhere['tab_user_play_info.promote_id'] = $teamLeaderId; + $userPlayInfoWhere2['ti.promote_id'] = $teamLeaderId; $userGameLoginWhere['tab_user_game_login_record.promote_id'] = $teamLeaderId; $spendWhere['tab_spend.promote_id'] = $teamLeaderId; } else { $childPromoteIds = $teamLeaderId . ',' . $childPromoteIds; $userPlayInfoWhere['tab_user_play_info.promote_id'] = ['in', $childPromoteIds]; + $userPlayInfoWhere2['ti.promote_id'] = ['in', $childPromoteIds]; $userGameLoginWhere['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds]; $spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds]; } @@ -1075,12 +1079,14 @@ class QueryController extends BaseController } $userPlayInfoWhere['tab_user_play_info.promote_id'] = $promoteId; + $userPlayInfoWhere2['ti.promote_id'] = $promoteId; $userGameLoginWhere['tab_user_game_login_record.promote_id'] = $promoteId; $spendWhere['tab_spend.promote_id'] = $promoteId; } if (!empty(I('own_id'))) { $userPlayInfoWhere['tab_user_play_info.promote_id'] = I('own_id'); + $userPlayInfoWhere2['ti.promote_id'] = I('own_id'); $userGameLoginWhere['tab_user_game_login_record.promote_id'] = I('own_id'); $spendWhere['tab_spend.promote_id'] = I('own_id'); } @@ -1094,6 +1100,7 @@ class QueryController extends BaseController if (!empty(I('sdk_version'))) { $userPlayInfoWhere['tab_user_play_info.sdk_version'] = I('sdk_version'); + $userPlayInfoWhere2['ti.sdk_version'] = I('sdk_version'); $userGameLoginWhere['tab_user_game_login_record.sdk_version'] = I('sdk_version'); $spendWhere['tab_spend.sdk_version'] = I('sdk_version'); } @@ -1111,6 +1118,7 @@ class QueryController extends BaseController $spendWhere['tab_spend.pay_status'] = 1; if (!empty(I('server_id'))) { $userPlayInfoWhere['tab_user_play_info.server_id'] = I('server_id'); + $userPlayInfoWhere2['ti.server_id'] = I('server_id'); $userGameLoginWhere['tab_user_game_login_record.server_id'] = I('server_id'); $spendWhere['tab_spend.server_id'] = I('server_id'); } @@ -1135,7 +1143,6 @@ class QueryController extends BaseController $allData['spend_voucher'] = 0; foreach ($data as &$list) { $thisDateTime = strtotime($list['day']); - $userPlayInfoWhere2 = $userPlayInfoWhere; $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]]; @@ -1153,35 +1160,53 @@ class QueryController extends BaseController ->group('tab_user_play_info.game_id,tab_user_play_info.user_id') ->select());//创角用户 + $newUserNumSql = $userPlayInfoModel + ->table('tab_user_play_info as ti') + ->where($userPlayInfoWhere2) + ->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) + ->fetchSql(true) + ->count(); $newUserNumData = $userPlayInfoModel - ->field('tab_user_play_info.create_time') + ->field('tab_user_play_info.create_time,(' . $newUserNumSql . ') as num') ->join($join) - ->where($userPlayInfoWhere2) + ->where($userPlayInfoWhere) ->where($map) ->group('tab_user_play_info.user_id') - ->having('tab_user_play_info.create_time between ' . $thisDateTime . ' and ' . ($thisDateTime + 86399)) + ->having('num = 0') ->order('tab_user_play_info.id') ->select(); $list['new_user_num'] = count($newUserNumData);//新创角用户 + $newDeviceSql = $userPlayInfoModel + ->table('tab_user_play_info as ti') + ->where($userPlayInfoWhere2) + ->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) + ->fetchSql(true) + ->count(); $newDeviceData = $userPlayInfoModel - ->field('tab_user_play_info.create_time') + ->field('tab_user_play_info.create_time,(' . $newDeviceSql . ') as num') ->join($join) - ->where($userPlayInfoWhere2) + ->where($userPlayInfoWhere) ->where($map) ->group('tab_user_play_info.create_device_number') - ->having('tab_user_play_info.create_time between ' . $thisDateTime . ' and ' . ($thisDateTime + 86399)) + ->having('num = 0') ->order('tab_user_play_info.id') ->select(); $list['new_device_num'] = count($newDeviceData);//新创角设备 + $newIpNumSql = $userPlayInfoModel + ->table('tab_user_play_info as ti') + ->where($userPlayInfoWhere2) + ->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) + ->fetchSql(true) + ->count(); $newIpNumData = $userPlayInfoModel - ->field('tab_user_play_info.create_time') + ->field('tab_user_play_info.create_time,(' . $newIpNumSql . ') as num') ->join($join) - ->where($userPlayInfoWhere2) + ->where($userPlayInfoWhere) ->where($map) ->group('tab_user_play_info.create_ip') - ->having('tab_user_play_info.create_time between ' . $thisDateTime . ' and ' . ($thisDateTime + 86399)) + ->having('num = 0') ->order('tab_user_play_info.id') ->select(); $list['new_ip_num'] = count($newIpNumData);//新增创角IP @@ -1480,9 +1505,10 @@ class QueryController extends BaseController ->select(); $list['new_ip_num'] = count($newIpData);//新增创角IP - $list['login_user_num'] = $userGameLoginModel + $list['login_user_num'] = count($userGameLoginModel ->where($userGameLoginMap) - ->count('distinct tab_user_game_login_record.user_id');//登录用户数 + ->group('tab_user_game_login_record.game_id,tab_user_game_login_record.user_id') + ->select());//登录用户数 $list['spend_user_num'] = $spendModel ->where($spendMap) @@ -2011,7 +2037,7 @@ class QueryController extends BaseController $subMap['pay_status'] = 1; $subMap['pay_game_status'] = 1; $subQuery = M('spend', 'tab_')->field('game_player_id')->where($subMap)->group('game_player_id')->having($having)->buildSql(); - $map['_string'] = 'role_id in ('. $subQuery . ')'; + $map['_string'] = 'role_id in (' . $subQuery . ')'; } $query = M('user_play_info', 'tab_')->where($map); list($roles, $pagination, $count) = $this->paginate($query); From 2f2158dbe02cd5f63b41aac89b2b922cf0543237 Mon Sep 17 00:00:00 2001 From: zyx Date: Thu, 24 Oct 2019 20:27:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/View/default/Promote/msg_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/View/default/Promote/msg_list.html b/Application/Home/View/default/Promote/msg_list.html index 221dc6a89..2fcbebbd7 100644 --- a/Application/Home/View/default/Promote/msg_list.html +++ b/Application/Home/View/default/Promote/msg_list.html @@ -34,7 +34,7 @@ - curr">资源号异常日志 + curr">资源号异常日志 {$rz_count} From 8b2e384fb6abec0a0040f323f4faba5b4a978b74 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 25 Oct 2019 10:44:02 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=98=8E=E7=BB=86->bug=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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index a2a242e79..fb854e150 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -248,9 +248,10 @@ class QueryController extends BaseController if (!empty($data)) { foreach ($data as &$list) { - $newLoginData = M('User', 'tab_') + $loginMap['user_id'] = $list['id']; + $newLoginData = M('UserLoginRecord', 'tab_') ->field('login_time,login_ip') - ->where(array('user_id' => $list['id'])) + ->where($loginMap) ->order('login_time desc') ->find(); From c1a9c3918e29c734bcf90f1952b584fb39775b4c Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 25 Oct 2019 11:17:41 +0800 Subject: [PATCH 4/5] =?UTF-8?q?SDK=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/SdkMenuController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/SdkMenuController.class.php b/Application/Admin/Controller/SdkMenuController.class.php index 43c9d8c52..f8f73fb12 100644 --- a/Application/Admin/Controller/SdkMenuController.class.php +++ b/Application/Admin/Controller/SdkMenuController.class.php @@ -12,7 +12,7 @@ class SdkMenuController extends ThinkController{ { foreach($config as $k => $v) { - $config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon']; + $config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['HTTP_HOST'] . $v['icon']; } } $this->assign('list',$config); @@ -93,7 +93,7 @@ class SdkMenuController extends ThinkController{ { if($v['id'] == $id) { - $v['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon']; + $v['icon'] = is_https()?'https://':'http://' . $_SERVER['HTTP_HOST'] . $v['icon']; $data = $v; break; } From 6cb3a9ad759baeab5900fa9b1ce0d34339c0e433 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 25 Oct 2019 11:18:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?SDK=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PersonalMenusController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/PersonalMenusController.class.php b/Application/Admin/Controller/PersonalMenusController.class.php index c5ac9f2d9..597eac534 100644 --- a/Application/Admin/Controller/PersonalMenusController.class.php +++ b/Application/Admin/Controller/PersonalMenusController.class.php @@ -12,7 +12,7 @@ class PersonalMenusController extends ThinkController{ { foreach($config as $k => $v) { - $config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon']; + $config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['HTTP_HOST'] . $v['icon']; } } $this->assign('list',$config); @@ -95,7 +95,7 @@ class PersonalMenusController extends ThinkController{ { if($v['id'] == $id) { - $v['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon']; + $v['icon'] = is_https()?'https://':'http://' . $_SERVER['HTTP_HOST'] . $v['icon']; $data = $v; break; }