Merge remote-tracking branch 'origin/dev' into dev

master
liuweiwen 5 years ago
commit f11150be0c

@ -1375,7 +1375,7 @@ class StatController extends ThinkController
$model = M('device_statistics','tab_');
if ($type == 0) {
$return = $model->sum('new_device');
$return = $model->where(['time'=>['neq',0]])->sum('new_device');
// $return = $device->all_device();
} else if($type == 1) {
$return = $model->where(['time'=>array('between',[$todaystart,$todaystart+86399])])->sum('new_device');

@ -141,9 +141,15 @@ class TimingController extends AdminController {
//当日新增设备
$newSql = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->where(['version'=>1])->group('unique_code')->select(false);
$data['new_device'] = M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime,$startTime+86399])])->order('create_time')->count();
$data['time'] = $startTime;
echo $data['new_device'].' ';
$duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])]);
$newSqls = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->group('unique_code')->select(false);
$data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSqls . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
$data['version'] = 1;
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>1])->find();
echo "\n";
if (!$getStatistics) {
@ -151,13 +157,14 @@ class TimingController extends AdminController {
} else {
M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>1])->save($data);
}
$data['duration7'] = 0;
echo date("Y-m-d",$startTime).' 苹果 ';
//当日新增设备
$newSql = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->where(['version'=>2])->group('unique_code')->select(false);
$data['new_device'] = M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime,$startTime+86399])])->order('create_time')->count();
echo $data['new_device'].' ';
$data['version'] = 2;
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>2])->find();
echo "\n";

@ -1854,7 +1854,13 @@ class DownloadController extends BaseController {
->group('tab_apply.game_id')
->order('g.sort desc,g.id desc')
->select();
$allGameIs = M('Apply', 'tab_')
->field('distinct tab_apply.game_id')
->join('tab_game as g on g.id = tab_apply.game_id')
->join($serverJoin)
->where($map)
->select();
$allGameIs = array_column($allGameIs, 'game_id');
$records = [];
if (!empty($data)) {
if (intval($endTime - $begTime) / (24 * 3600) <= 30) {
@ -1902,6 +1908,30 @@ class DownloadController extends BaseController {
'spend_voucher' => 0,
];
}
$params['all_data'] = 1;
$params['game_ids'] = $allGameIs;
$allData['game_name'] = "合计";
$allData['sdk_version'] = '--';
$allData['role_num'] = $userRepository->getCreateRoleCountByGame($params);//创角数
$allData['user_num'] = $userRepository->getCreateRoleUserCountByGame($params);//创角用户
$allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户
$allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备
$allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP
$allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数
$allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
$allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数
unset($params['pay_way']);
$allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
$allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值
$params['pay_way'] = 0;
$allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值
$params['pay_way'] = -1;
$allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值
$allData['spend_discount'] = '0.00';
$allData['spend_voucher'] = '0.00';
$records[] = $allData;
}
}
@ -2797,7 +2827,7 @@ class DownloadController extends BaseController {
array('role_level','等级'),
array('recharge_cost','充值总额'),
array('recharge_count','充值次数'),
array('recharge_cost_today','日充值'),
array('recharge_cost_today','日充值'),
array('unlogin_day','未登录天数'),
array('play_time','最后登录时间'),
array('promote_account','推广员账号'),

Loading…
Cancel
Save