推广平台->数据管理--更新

master
chenxiaojun 5 years ago
parent bd6932d8d4
commit 80f76c4490

@ -133,8 +133,13 @@ class UserRepository
$dayList = $params['dayList'] ?? [];
$params['time_column'] = 'create_time';
$conditions = $this->getDayGroupConditions($params);
$items = M('login_daily_record', 'tab_')->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day, count(DISTINCT user_id, game_id) as count')
$subQuery = M('login_daily_record', 'tab_')->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT user_id) as count')
->where($conditions)
->group('game_id')
->buildSql();
$items = M()->field('*,sum(count) as count')
->table($subQuery)
->alias('a')
->group('day')
->select();
@ -294,8 +299,13 @@ class UserRepository
$params['time_column'] = 'create_time';
$conditions = $this->getCreateRoleConditions($params);
$items = M('user_play_info', 'tab_')->field('count(distinct game_id,user_id) count, FROM_UNIXTIME(create_time, "%Y-%m-%d") as day')
$subQuery = M('user_play_info', 'tab_')->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT user_id) as count')
->where($conditions)
->group('game_id')
->buildSql();
$items = M()->field('*,sum(count) as count')
->table($subQuery)
->alias('a')
->group('day')
->select();
return $this->assembleRecords($items, $dayList, 'count');
@ -346,10 +356,14 @@ class UserRepository
->where("ti.user_id = user_id and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,user_id) count, FROM_UNIXTIME(create_time, '%Y-%m-%d') as day,
(" . $sql . ") as num")
$subQuery = $model->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT user_id) as count')
->where($conditions)
->group("day")
->group('game_id')
->buildSql();
$items = M()->field("*,sum(count) as count,(" . $sql . ") as num")
->table($subQuery)
->alias('a')
->group('day')
->having('num = 0')
->select();
return $this->assembleRecords($items, $dayList, 'count');
@ -411,10 +425,14 @@ class UserRepository
->where("ti.create_device_number = create_device_number and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,create_device_number) count, FROM_UNIXTIME(create_time, '%Y-%m-%d') as day,
(" . $sql . ") as num")
$subQuery = $model->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT create_device_number) as count')
->where($conditions)
->group("day")
->group('game_id')
->buildSql();
$items = M()->field("*,sum(count) as count,(" . $sql . ") as num")
->table($subQuery)
->alias('a')
->group('day')
->having('num = 0')
->select();
return $this->assembleRecords($items, $dayList, 'count');
@ -476,10 +494,14 @@ class UserRepository
->where("ti.create_ip = create_ip and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,create_ip) count, FROM_UNIXTIME(create_time, '%Y-%m-%d') as day,
(" . $sql . ") as num")
$subQuery = $model->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT create_ip) as count')
->where($conditions)
->group("day")
->group('game_id')
->buildSql();
$items = M()->field("*,sum(count) as count,(" . $sql . ") as num")
->table($subQuery)
->alias('a')
->group('day')
->having('num = 0')
->select();
return $this->assembleRecords($items, $dayList, 'count');

@ -1834,7 +1834,7 @@ class QueryController extends BaseController
->having('recharge_cost > 0')
->order('play_time desc')
->buildSql();
$query = M()->field(' * ')
$query = M()->field('*')
->table($subQuery)
->alias('a')
->order($orderBy);

@ -60,7 +60,7 @@
<label> ~ </label>
<input type="text" class="txt integer-input" name="role_level_end" style="width: 50px" value="{:I('role_level_end')}" >
</div>
<div class="form-group">
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/userRoles','model='.$model['name'],false)}"
value="查询">
</div>
@ -107,7 +107,7 @@
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/userRoles_data_export',array_merge(['xlsname'=>'ceshi'],I('post.')))}" class="ajax-get">导出</a>
<a id="sch-btn" data-href="{:U('download/userRoles_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>

Loading…
Cancel
Save