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 | +登录用户数 | -充值人数 | -充值次数 | -充值总额 | -现金充值 | -通用币充值 | -绑定币充值 | +充值人数 | +充值次数 | +充值总额 | +现金充值 | +通用币充值 | +绑定币充值 | 操作 | 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 @@ +
---|