diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 7f5c1709f..2ca2a0fc4 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -4070,20 +4070,23 @@ class ExportController extends Controller $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) { $error = '时间间隔不能超过31天'; $status = false; } + $searchGameId = 0; if ($status) { $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([ 'base_uri' => C('TASK_URL'), @@ -4095,7 +4098,7 @@ class ExportController extends Controller 'start_time' => $start, 'end_time' => $end, 'promote_id' => I('promote_id', 0), - 'game_id' => $gameId, + 'game_ids' => $gameIds, ] ]); @@ -4104,7 +4107,7 @@ class ExportController extends Controller if (!$result) { $this->error('数据请求异常!'); } - $gameName = get_game_name($gameId); + $gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name']; $promoteName = '全部'; if ($promoteId) { $promoteName = get_promote_account($promoteId); diff --git a/Application/Admin/Controller/StatController.class.php b/Application/Admin/Controller/StatController.class.php index bb95ec29d..a085d0296 100644 --- a/Application/Admin/Controller/StatController.class.php +++ b/Application/Admin/Controller/StatController.class.php @@ -167,20 +167,23 @@ class StatController extends ThinkController $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) { $error = '时间间隔不能超过31天'; $status = false; } + $searchGameId = 0; if ($status) { $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([ 'base_uri' => C('TASK_URL'), @@ -192,7 +195,7 @@ class StatController extends ThinkController 'start_time' => $start, 'end_time' => $end, 'promote_id' => I('promote_id', 0), - 'game_id' => $gameId, + 'game_ids' => $gameIds, ] ]); @@ -203,7 +206,7 @@ class StatController extends ThinkController } $data = $result['data']['records']; $dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30]; - $gameName = get_game_name($gameId); + $gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name']; $promoteName = '全部'; if ($promoteId) { $promoteName = get_promote_account($promoteId);