Merge branch 'hotfix/promote_role_list' of wmtx/platform into release

推广后台角色列表优化
master
廖金灵 4 years ago committed by Gogs
commit 04866ef988

@ -2880,18 +2880,51 @@ public function iosDetailExcelInfo($id,$map) {
array('user_account','玩家账号'),
array('promote_account','推广账号'),
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_name','角色名'),
array('role_level','等级'),
array('create_time','创建时间'),
);
$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']);
if($value1['create_time'] == 0) {
$value1['create_time'] = date('Y-m-d H:i:s', $value1['play_time']);
} else {
$value1['create_time'] = date('Y-m-d H:i:s', $value1['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);

@ -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);
@ -1739,28 +1745,63 @@ 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();
$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');
$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 .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
if($record['create_time'] == 0) {
$records[$key]['create_time'] = date('Y-m-d', $value['play_time']) . '<br>' . date('H:i:s', $value['play_time']);
} else {
$records[$key]['create_time'] = date('Y-m-d', $value['create_time']) . '<br>' . 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']) . '<br>' . date('H:i:s', $user['register_time']);
$records[$key]['login_time'] = date('Y-m-d', $user['login_time']) . '<br>' . 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();
$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);

@ -10,6 +10,9 @@
line-height: 34px;
height: 34px;
}
.pointer-hand {
cursor: pointer;
}
</style>
</block>
<block name="body">
@ -80,19 +83,19 @@
<table class="table normal_table">
<tr class="odd">
<th>账号(姓名)</th>
<th>创角数</th>
<th>创角用户</th>
<th>新创角用户</th>
<th class="pointer-hand" title="统计时间范围内,成功创建角色数量">创角数</th>
<th class="pointer-hand" title="统计时间范围内,成功创角的用户数(去重)">创角用户</th>
<th class="pointer-hand" title="统计时间范围内,首次创建角色的用户数">新创角用户</th>
<!-- <th>新创角设备</th> -->
<th>新创角IP</th>
<th>登录用户数</th>
<th class="pointer-hand" title="统计时间范围内首次创建角色IP总数去重">创角IP</th>
<th class="pointer-hand" title="统计时间范围内,登录的用户数(去重)">登录用户数</th>
<?php if($canViewUserRecharge):?>
<th>充值人数</th>
<th>充值次数</th>
<th>充值总额</th>
<th>现金充值</th>
<th>通用币充值</th>
<th>绑定币充值</th>
<th class="pointer-hand" title="统计时间范围内,在游戏内充值成功的订单的用户数(去重)">充值人数</th>
<th class="pointer-hand" title="统计时间范围内,在游戏内充值成功的订单数量">充值次数</th>
<th class="pointer-hand" title="统计时间范围内,在游戏内充值成功的订单金额总和">充值总额</th>
<th class="pointer-hand" title="统计时间范围内,在游戏内充值成功的订单,使用现金支付金额总和">现金充值</th>
<th class="pointer-hand" title="统计时间范围内,在游戏内充值成功的订单,使用通用币支付金额总和">通用币充值</th>
<th class="pointer-hand" title="统计时间范围内,在游戏内充值成功的订单,使用绑定币支付金额总和">绑定币充值</th>
<?php endif;?>
<?php if($parent['level'] < 4):?>
<th>操作</th>

@ -74,6 +74,13 @@
<th>玩家帐号</th>
<th>推广账号</th>
<th>游戏名称</th>
<th>设备码</th>
<th>注册时间</th>
<th>注册IP</th>
<th>最近登录时间</th>
<th>最近登录IP</th>
<th>平台</th>
<th>游戏区服</th>
<th>角色名</th>
@ -88,17 +95,18 @@
<td>{$record.user_account}</td>
<td>{$record.promote_account}</td>
<td>{$record.game_name}</td>
<td>{$record.device_number}</td>
<td>{$record.register_time}</td>
<td>{$record.register_ip}</td>
<td>{$record.login_time}</td>
<td>{$record.login_ip}</td>
<td>{:getSDKTypeName($record['sdk_version'])}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.role_level}</td>
<td>
<?php if($record['create_time'] == 0):?>
{$record.play_time|date='Y-m-d H:i:s',###}
<?php else:?>
{$record.create_time|date='Y-m-d H:i:s',###}
<?php endif;?>
</td>
<td>{$record.create_time}</td>
</tr>
</volist>
</empty>
@ -111,6 +119,12 @@
<?php endif ;?>
{$pagination}
</div>
<div class="summary">
<div class="item">注册数:{$user_count}</div>
<div class="item">去重后注册数:{$unique_user_count}</div>
<div class="item">创角数:{$count}</div>
<div class="item">去重后创角数:{$unique_count}</div>
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">

@ -393,10 +393,27 @@ 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
}
.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;

Loading…
Cancel
Save