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