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; } 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; } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 285c7416a..88e859ff5 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(); @@ -1036,12 +1037,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 +1059,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 +1080,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 +1101,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 +1119,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 +1144,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 +1161,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 +1506,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) @@ -2010,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)->order('play_time desc'); list($roles, $pagination, $count) = $this->paginate($query); 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}