Merge branch 'feature/agg_game_fail' of wmtx/platform into release

留存率不区分设备
master
廖金灵 4 years ago committed by Gogs
commit c633109176

@ -4070,20 +4070,23 @@ class ExportController extends Controller
$error = '请选择游戏!'; $error = '请选择游戏!';
$status = false; $status = false;
} }
if ($deviceType == '') {
$error = '请选择设备类型!';
$status = false;
}
$startTime = strtotime($start . ' 00:00:00'); $startTime = strtotime($start . ' 00:00:00');
$endTime = strtotime($end . ' 23:59:59') + 1; $endTime = strtotime($end . ' 23:59:59') + 1;
if ((($endTime - $startTime)/(24*3600)) > 31) { if ((($endTime - $startTime)/(24*3600)) > 31) {
$error = '时间间隔不能超过31天'; $error = '时间间隔不能超过31天';
$status = false; $status = false;
} }
$searchGameId = 0;
if ($status) { if ($status) {
$baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find(); $baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find();
$gameId = $deviceType == 'android' ? $baseGame['android_game_id'] : $baseGame['ios_game_id']; $gameIds = [];
if ($deviceType) {
$searchGameId = $deviceType == 'android' ? $baseGame['android_game_id'] : $baseGame['ios_game_id'];
$gameIds[] = $searchGameId;
} else {
$gameIds = [$baseGame['android_game_id'], $baseGame['ios_game_id']];
}
$client = new Client([ $client = new Client([
'base_uri' => C('TASK_URL'), 'base_uri' => C('TASK_URL'),
@ -4095,7 +4098,7 @@ class ExportController extends Controller
'start_time' => $start, 'start_time' => $start,
'end_time' => $end, 'end_time' => $end,
'promote_id' => I('promote_id', 0), 'promote_id' => I('promote_id', 0),
'game_id' => $gameId, 'game_ids' => $gameIds,
] ]
]); ]);
@ -4104,7 +4107,7 @@ class ExportController extends Controller
if (!$result) { if (!$result) {
$this->error('数据请求异常!'); $this->error('数据请求异常!');
} }
$gameName = get_game_name($gameId); $gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name'];
$promoteName = '全部'; $promoteName = '全部';
if ($promoteId) { if ($promoteId) {
$promoteName = get_promote_account($promoteId); $promoteName = get_promote_account($promoteId);

@ -167,20 +167,23 @@ class StatController extends ThinkController
$error = '请选择游戏!'; $error = '请选择游戏!';
$status = false; $status = false;
} }
if ($deviceType == '') {
$error = '请选择设备类型!';
$status = false;
}
$startTime = strtotime($start . ' 00:00:00'); $startTime = strtotime($start . ' 00:00:00');
$endTime = strtotime($end . ' 23:59:59') + 1; $endTime = strtotime($end . ' 23:59:59') + 1;
if ((($endTime - $startTime)/(24*3600)) > 31) { if ((($endTime - $startTime)/(24*3600)) > 31) {
$error = '时间间隔不能超过31天'; $error = '时间间隔不能超过31天';
$status = false; $status = false;
} }
$searchGameId = 0;
if ($status) { if ($status) {
$baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find(); $baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find();
$gameId = $deviceType == 'android' ? $baseGame['android_game_id'] : $baseGame['ios_game_id']; $gameIds = [];
if ($deviceType) {
$searchGameId = $deviceType == 'android' ? $baseGame['android_game_id'] : $baseGame['ios_game_id'];
$gameIds[] = $searchGameId;
} else {
$gameIds = [$baseGame['android_game_id'], $baseGame['ios_game_id']];
}
$client = new Client([ $client = new Client([
'base_uri' => C('TASK_URL'), 'base_uri' => C('TASK_URL'),
@ -192,7 +195,7 @@ class StatController extends ThinkController
'start_time' => $start, 'start_time' => $start,
'end_time' => $end, 'end_time' => $end,
'promote_id' => I('promote_id', 0), 'promote_id' => I('promote_id', 0),
'game_id' => $gameId, 'game_ids' => $gameIds,
] ]
]); ]);
@ -203,7 +206,7 @@ class StatController extends ThinkController
} }
$data = $result['data']['records']; $data = $result['data']['records'];
$dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30]; $dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30];
$gameName = get_game_name($gameId); $gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name'];
$promoteName = '全部'; $promoteName = '全部';
if ($promoteId) { if ($promoteId) {
$promoteName = get_promote_account($promoteId); $promoteName = get_promote_account($promoteId);

Loading…
Cancel
Save