|
|
|
@ -145,7 +145,8 @@ class StatController extends ThinkController
|
|
|
|
|
$start = I('start', date('Y-m-d',strtotime('-7 day')));
|
|
|
|
|
$end = empty(I('end')) ? time_format(time(),'Y-m-d') : I('end');
|
|
|
|
|
$dataOrder = I('data_order', '');
|
|
|
|
|
$gameId = I('game_id', 0);
|
|
|
|
|
$baseGameId = I('game_id', 0);
|
|
|
|
|
$deviceType = I('device_type', '');
|
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
|
|
|
|
|
|
$orderType = 'asc';
|
|
|
|
@ -160,10 +161,14 @@ class StatController extends ThinkController
|
|
|
|
|
$status = true;
|
|
|
|
|
$data = false;
|
|
|
|
|
$error = '';
|
|
|
|
|
if ($gameId == 0) {
|
|
|
|
|
if ($baseGameId == 0) {
|
|
|
|
|
$error = '请选择游戏!';
|
|
|
|
|
$status = false;
|
|
|
|
|
}
|
|
|
|
|
if ($deviceType == '') {
|
|
|
|
|
$error = '请选择设备类型!';
|
|
|
|
|
$status = false;
|
|
|
|
|
}
|
|
|
|
|
$startTime = strtotime($start . ' 00:00:00');
|
|
|
|
|
$endTime = strtotime($end . ' 23:59:59') + 1;
|
|
|
|
|
if ((($endTime - $startTime)/(24*3600)) > 31) {
|
|
|
|
@ -171,6 +176,10 @@ class StatController extends ThinkController
|
|
|
|
|
$status = false;
|
|
|
|
|
}
|
|
|
|
|
if ($status) {
|
|
|
|
|
|
|
|
|
|
$baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find();
|
|
|
|
|
$gameId = $deviceType == 'android' ? $baseGame['android_game_id'] : $baseGame['ios_game_id'];
|
|
|
|
|
|
|
|
|
|
$client = new Client([
|
|
|
|
|
'base_uri' => C('TASK_URL'),
|
|
|
|
|
'timeout' => 10.0,
|
|
|
|
@ -216,7 +225,9 @@ class StatController extends ThinkController
|
|
|
|
|
$this->assign('error', $error);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->assign('data', $data);
|
|
|
|
|
$baseGames = M('base_game', 'tab_')->select();
|
|
|
|
|
|
|
|
|
|
$this->assign('baseGames', $baseGames);
|
|
|
|
|
$this->assign('order_type', $orderType);
|
|
|
|
|
$this->assign('order_column', $orderColumn);
|
|
|
|
|
$this->assign('data', $data);
|
|
|
|
@ -675,9 +686,10 @@ AND UNIX_TIMESTAMP(
|
|
|
|
|
{
|
|
|
|
|
$start = I('start', date('Y-m-d'));
|
|
|
|
|
$end = I('end', date('Y-m-d'));
|
|
|
|
|
$gameIds = I('game_ids', '');
|
|
|
|
|
$baseGameIds = I('game_ids', '');
|
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
|
$dataOrder = I('data_order', '');
|
|
|
|
|
$deviceType = I('device_type', '');
|
|
|
|
|
$containBindCoins = I('contain_bind_coins', 0);
|
|
|
|
|
|
|
|
|
|
$orderType = '';
|
|
|
|
@ -697,15 +709,42 @@ AND UNIX_TIMESTAMP(
|
|
|
|
|
|
|
|
|
|
$startTime = strtotime($start . ' 00:00:00');
|
|
|
|
|
$endTime = strtotime($end . ' 23:59:59');
|
|
|
|
|
$gameIdRows = $gameIds ? explode(',', $gameIds) : [];
|
|
|
|
|
|
|
|
|
|
$baseGameIdRows = $baseGameIds ? explode(',', $baseGameIds) : [];
|
|
|
|
|
$baseGames = M('base_game', 'tab_')->select();
|
|
|
|
|
|
|
|
|
|
$gameIds = null;
|
|
|
|
|
$conditions = [];
|
|
|
|
|
if (count($gameIdRows)) {
|
|
|
|
|
$conditions['game_id'] = ['in', $gameIdRows];
|
|
|
|
|
if (count($baseGameIdRows)) {
|
|
|
|
|
$tmpBaseGames = M('base_game', 'tab_')->where(['id' => ['in', $baseGameIdRows]])->select();
|
|
|
|
|
$gameIds = array_merge(array_column($tmpBaseGames, 'android_game_id'), array_column($tmpBaseGames, 'ios_game_id'));
|
|
|
|
|
}
|
|
|
|
|
if (count($promoteIds)) {
|
|
|
|
|
$conditions['promote_id'] = ['in', $promoteIds];
|
|
|
|
|
}
|
|
|
|
|
if ($deviceType != '') {
|
|
|
|
|
if ($gameIds) {
|
|
|
|
|
$gameIds = (
|
|
|
|
|
$deviceType == 'android' ?
|
|
|
|
|
array_intersect($gameIds, array_column($baseGames, 'android_game_id')) :
|
|
|
|
|
array_intersect($gameIds, array_column($baseGames, 'ios_game_id'))
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$gameIds = (
|
|
|
|
|
$deviceType == 'android' ?
|
|
|
|
|
array_column($baseGames, 'android_game_id') :
|
|
|
|
|
array_column($baseGames, 'ios_game_id')
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($gameIds && count($gameIds)) {
|
|
|
|
|
if (count($gameIds)) {
|
|
|
|
|
$conditions['game_id'] = ['in', $gameIds];
|
|
|
|
|
} else {
|
|
|
|
|
$conditions['game_id'] = ['in', 0];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 新增用户
|
|
|
|
|
|
|
|
|
|
/* M('user', 'tab_')
|
|
|
|
@ -795,6 +834,7 @@ AND UNIX_TIMESTAMP(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->meta_title = 'ARPU统计';
|
|
|
|
|
$this->assign('baseGames', $baseGames);
|
|
|
|
|
$this->assign('records', $rows);
|
|
|
|
|
$this->assign('order', $order);
|
|
|
|
|
$this->assign('orderType', $orderType);
|
|
|
|
|