|
|
|
@ -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);
|
|
|
|
|