From df933cc6b1e99c31ffaa4cb14f6b7b2aec2b665b Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 16 Sep 2020 20:56:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 43 ++++++++++++++++--- .../Home/Controller/QueryController.class.php | 32 ++++++++++++-- .../Home/View/default/Query/userRoles.html | 22 +++++++--- Public/Home/css/20180207/common.css | 3 ++ 4 files changed, 84 insertions(+), 16 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index fd917bb7f..eeaffe07e 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2879,7 +2879,14 @@ public function iosDetailExcelInfo($id,$map) { $xlsCell = array( array('user_account','玩家账号'), array('promote_account','推广账号'), - array('game_name','游戏名称'), + array('game_name','游戏名称'), + + array('device_number','设备码'), + array('register_time','注册时间'), + array('register_ip','注册IP'), + array('login_time','最近登录时间'), + array('login_ip','最近登录IP'), + array('server_name','区服'), array('role_name','游戏昵称'), array('role_level','等级'), @@ -2887,12 +2894,38 @@ public function iosDetailExcelInfo($id,$map) { ); $records = recordPromoteLogs('数据管理','角色查询导出'); $model = M('user_play_info','tab_'); - $data = $model->field('user_account,promote_account,game_name,server_name,role_name,role_level,create_time')->where($map)->order('create_time desc')->select(); + $data = $model->field('user_id,user_account,promote_account,game_name,server_name,role_name,role_level,create_time,play_time')->where($map)->order('create_time desc')->select(); + + $users = []; + if (count($data) > 0) { + $userIds = array_column($data, 'user_id'); + $users = M('user', 'tab_')->field(['id', 'register_time', 'login_time', 'register_ip', 'login_ip', 'device_number'])->where(['id' => ['in', $userIds]])->select(); + $users = index_by_column('id', $users); + } + $xlsData = []; foreach ($data as $key1 => $value1) { - $value1['user_account'] = $this->encryption($value1['user_account']); - $value1['create_time'] = date('Y-m-d H:i:s',$value1['create_time']); - $xlsData[] = $value1; + $value1['user_account'] = $this->encryption($value1['user_account']); + if($value1['create_time'] == 0) { + $value1['create_time'] = date('Y-m-d H:i:s', $value['play_time']); + } else { + $value1['create_time'] = date('Y-m-d H:i:s', $value['create_time']); + } + if (isset($users[$value1['user_id']])) { + $user = $users[$value1['user_id']]; + $value1['register_time'] = date('Y-m-d H:i:s', $user['register_time']); + $value1['login_time'] = date('Y-m-d H:i:s', $user['login_time']); + $value1['register_ip'] = $user['register_ip']; + $value1['login_ip'] = $user['login_ip']; + $value1['device_number'] = $user['device_number']; + } else { + $value1['register_time'] = '--'; + $value1['login_time'] = '--'; + $value1['register_ip'] = '--'; + $value1['login_ip'] = '--'; + $value1['device_number'] = '--'; + } + $xlsData[] = $value1; } $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 90c411456..435fbe821 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1739,24 +1739,48 @@ class QueryController extends BaseController } $query = M('user_play_info', 'tab_')->where($map)->order('create_time desc'); list($records, $pagination, $count) = $this->paginate($query); -// var_dump($records);die(); + + $users = []; + if (count($records) > 0) { + $userIds = array_column($records, 'user_id'); + $users = M('user', 'tab_')->field(['id', 'register_time', 'login_time', 'register_ip', 'login_ip', 'device_number'])->where(['id' => ['in', $userIds]])->select(); + $users = index_by_column('id', $users); + } + foreach ($records as $key => $value) { //订单隐藏算法 $orderLen = strlen($value['user_account']); $strLen = 3; $hideChar = ''; - if ($orderLen <= 8) { $strLen = 2; } - for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { $hideChar .= '*'; } + + if($record['create_time'] == 0) { + $records[$key]['create_time'] = date('Y-m-d', $value['play_time']) . '
' . date('H:i:s', $value['play_time']); + } else { + $records[$key]['create_time'] = date('Y-m-d', $value['create_time']) . '
' . date('H:i:s', $value['create_time']); + } $records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen); - + if (isset($users[$value['user_id']])) { + $user = $users[$value['user_id']]; + $records[$key]['register_time'] = date('Y-m-d', $user['register_time']) . '
' . date('H:i:s', $user['register_time']); + $records[$key]['login_time'] = date('Y-m-d', $user['login_time']) . '
' . date('H:i:s', $user['login_time']); + $records[$key]['register_ip'] = $user['register_ip']; + $records[$key]['login_ip'] = $user['login_ip']; + $records[$key]['device_number'] = $user['device_number']; + } else { + $records[$key]['register_time'] = '--'; + $records[$key]['login_time'] = '--'; + $records[$key]['register_ip'] = '--'; + $records[$key]['login_ip'] = '--'; + $records[$key]['device_number'] = '--'; + } } $games = get_promote_serach_game(); diff --git a/Application/Home/View/default/Query/userRoles.html b/Application/Home/View/default/Query/userRoles.html index 51b221cec..8941bed1d 100644 --- a/Application/Home/View/default/Query/userRoles.html +++ b/Application/Home/View/default/Query/userRoles.html @@ -74,6 +74,13 @@ 玩家帐号 推广账号 游戏名称 + + 设备码 + 注册时间 + 注册IP + 最近登录时间 + 最近登录IP + 平台 游戏区服 角色名 @@ -88,17 +95,18 @@ {$record.user_account} {$record.promote_account} {$record.game_name} + + {$record.device_number} + {$record.register_time} + {$record.register_ip} + {$record.login_time} + {$record.login_ip} + {:getSDKTypeName($record['sdk_version'])} {$record.server_name} {$record.role_name} {$record.role_level} - - - {$record.play_time|date='Y-m-d H:i:s',###} - - {$record.create_time|date='Y-m-d H:i:s',###} - - + {$record.create_time} diff --git a/Public/Home/css/20180207/common.css b/Public/Home/css/20180207/common.css index 83d318091..9c7b86dc1 100644 --- a/Public/Home/css/20180207/common.css +++ b/Public/Home/css/20180207/common.css @@ -393,6 +393,9 @@ input,select,button{outline:none;font-size:14px;font-family:inherit;} padding: 0 15px; } +.normal_table tr td { + padding: 5px 0px; +} .normal_table tr td a { color: #06C } From 919791c0c75a46f4ffa9b75091a2986c3c8f23fa Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 17 Sep 2020 14:32:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 4 +-- .../Home/Controller/QueryController.class.php | 21 ++++++++++++++-- .../Home/View/default/Query/achievement.html | 25 +++++++++++-------- .../Home/View/default/Query/userRoles.html | 12 ++++++--- Public/Home/css/20180207/common.css | 14 +++++++++++ 5 files changed, 58 insertions(+), 18 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index eeaffe07e..c884d2bb2 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2907,9 +2907,9 @@ public function iosDetailExcelInfo($id,$map) { foreach ($data as $key1 => $value1) { $value1['user_account'] = $this->encryption($value1['user_account']); if($value1['create_time'] == 0) { - $value1['create_time'] = date('Y-m-d H:i:s', $value['play_time']); + $value1['create_time'] = date('Y-m-d H:i:s', $value1['play_time']); } else { - $value1['create_time'] = date('Y-m-d H:i:s', $value['create_time']); + $value1['create_time'] = date('Y-m-d H:i:s', $value1['create_time']); } if (isset($users[$value1['user_id']])) { $user = $users[$value1['user_id']]; diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 435fbe821..0c3222223 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1687,7 +1687,13 @@ class QueryController extends BaseController $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - $map[] = [ + $promoteService = new PromoteService(); + $subInSql = $promoteService->subInSql($queryPromote); + + $map = []; + $map['_string'] = '1=1'; + $map['_string'] .= ' and promote_id in (' . $subInSql . ')'; + /* $map[] = [ '_logic' => 'or', 'id' => $queryPromote['id'], 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] @@ -1699,7 +1705,7 @@ class QueryController extends BaseController $map = ['promote_id' => ['in', $ids]]; } else { $map['_string'] = '1<>1'; - } + } */ if ($relationGameId != 0 || $sdkVersion != 0) { $gameIds = gameSearch($relationGameId, $sdkVersion); @@ -1740,6 +1746,13 @@ class QueryController extends BaseController $query = M('user_play_info', 'tab_')->where($map)->order('create_time desc'); list($records, $pagination, $count) = $this->paginate($query); + $countRow = M('user_play_info', 'tab_')->field(['count(distinct user_id) user_count'])->where($map)->find(); + + $countMap = $map; + $subSql = M('user', 'tab_')->field('id')->where(['is_repeat' => 0])->select(false); + $countMap['_string'] .= ' and user_id in (' . $subSql . ')'; + $uniqueCountRow = M('user_play_info', 'tab_')->field(['count(distinct user_id) user_count, count(*) count'])->where($countMap)->find(); + $users = []; if (count($records) > 0) { $userIds = array_column($records, 'user_id'); @@ -1785,6 +1798,10 @@ class QueryController extends BaseController $games = get_promote_serach_game(); + $this->assign('user_count', $countRow['user_count']); + $this->assign('unique_user_count', $uniqueCountRow['user_count']); + $this->assign('unique_count', $uniqueCountRow['count']); + $this->assign('games', $games); $this->assign('records', $records); $this->assign('pagination', $pagination); diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html index 460cd03c0..cd632e8b1 100644 --- a/Application/Home/View/default/Query/achievement.html +++ b/Application/Home/View/default/Query/achievement.html @@ -10,6 +10,9 @@ line-height: 34px; height: 34px; } + .pointer-hand { + cursor: pointer; + } @@ -80,19 +83,19 @@ - - - + + + - - + + - - - - - - + + + + + + diff --git a/Application/Home/View/default/Query/userRoles.html b/Application/Home/View/default/Query/userRoles.html index 8941bed1d..6fd9e83ee 100644 --- a/Application/Home/View/default/Query/userRoles.html +++ b/Application/Home/View/default/Query/userRoles.html @@ -114,11 +114,17 @@
- - 导出 - + + 导出 + {$pagination}
+
+
注册数:{$user_count}
+
去重后注册数:{$unique_user_count}
+
创角数:{$count}
+
去重后创角数:{$unique_count}
+
diff --git a/Public/Home/css/20180207/common.css b/Public/Home/css/20180207/common.css index 9c7b86dc1..8c46f1df4 100644 --- a/Public/Home/css/20180207/common.css +++ b/Public/Home/css/20180207/common.css @@ -400,6 +400,20 @@ input,select,button{outline:none;font-size:14px;font-family:inherit;} color: #06C } +.page-list .summary{ + margin-bottom: 10px; +} +.page-list .summary .item { + display: inline-block; + margin-right: 10px; +} +.page-list .summary + .pagenation { + padding-top: 0px; +} +.page-list .summary + .pagenation .rows { + top: 0px; +} + .el-button { display: inline-block; line-height: 1; From 02c4b00bfef2f69cdc14043111f9ae7c0857c64a Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 18 Sep 2020 13:52:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= 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 c884d2bb2..7c0d13d60 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2888,7 +2888,7 @@ public function iosDetailExcelInfo($id,$map) { array('login_ip','最近登录IP'), array('server_name','区服'), - array('role_name','游戏昵称'), + array('role_name','角色名'), array('role_level','等级'), array('create_time','创建时间'), );
账号(姓名)创角数创角用户新创角用户创角数创角用户新创角用户 新创角IP登录用户数新增创角IP登录用户数 充值人数充值次数充值总额现金充值通用币充值绑定币充值充值人数充值次数充值总额现金充值通用币充值绑定币充值 操作