diff --git a/Application/Base/Repository/SpendRepository.class.php b/Application/Base/Repository/SpendRepository.class.php index fb2009543..0c6331037 100644 --- a/Application/Base/Repository/SpendRepository.class.php +++ b/Application/Base/Repository/SpendRepository.class.php @@ -80,6 +80,7 @@ class SpendRepository $serverId = $params['server_id'] ?? 0; $ids = $params['promote_id'] ?? []; $isBan = $params['is_ban'] ?? false; + $sdkVersion = $params['sdk_version'] ?? 0; $conditions = []; $conditions['pay_status'] = 1; @@ -97,6 +98,9 @@ class SpendRepository if (isset($params['server_id'])) { $conditions['server_id'] = $serverId; } + if ($sdkVersion > 0) { + $conditions['sdk_version'] = $sdkVersion; + } $conditions = $this->withIsCheck($conditions); diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 360f4df89..45befa238 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -840,7 +840,8 @@ class DownloadController extends BaseController $time = I('time', ''); $time = $time == '' ? $defaultTime : $time; $sdkVersion = I('sdk_version', 0); - $gameId = I('game_id', 0); + // $gameId = I('game_id', 0); + $relationGameId = I('relation_game_id', 0); $serverId = I('server_id', 0); $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; @@ -887,11 +888,16 @@ class DownloadController extends BaseController $map['_string'] = '1<>1'; } - $searchGameName = ''; + $searchGameName = ''; $searchServerName = ''; - if ($gameId > 0) { - $map['game_id'] = $gameId; - $searchGameName = M('game', 'tab_')->where(['id' => $gameId])->getField('game_name'); + if ($relationGameId > 0) { + $subMap = ['relation_game_id' => $relationGameId]; + if ($sdkVersion > 0 && in_array($sdkVersion, [1, 2])) { + $subMap['sdk_version'] = $sdkVersion; + } + $searchGames = M('game', 'tab_')->field(['id', 'game_name'])->where($subMap)->select(); + $params['game_id'] = array_column($searchGames, 'id'); + $searchGameName = str_replace('(苹果版)', '', str_replace('(安卓版)', '', $searchGames[0]['game_name'])); } if ($serverId > 0) { $map['server_id'] = $serverId; @@ -3608,7 +3614,7 @@ public function iosDetailExcelInfo($id,$map) { array('payAmount','付费总额'), array('payRate','付费率'), array('newPayAmount','新增付费额'), - array('historyPayCount','累计付费用户'), + // array('historyPayCount','累计付费用户'), array('arpu','ARPU'), array('arppu','ARPPU'), ); @@ -3624,7 +3630,7 @@ public function iosDetailExcelInfo($id,$map) { $newPayUserCountList = $spendRepository->getNewPayUserCountGroupByDay($params); $payAmountList = $spendRepository->getPayAmountGroupByDay($params); $newPayAmountList = $spendRepository->getNewPayAmountGroupByDay($params); - $historyPayCountList = $spendRepository->getHistoryPayCountGroupByDay($params); + // $historyPayCountList = $spendRepository->getHistoryPayCountGroupByDay($params); $loginCountList = $userRepository->getLoginCountGroupByDay($params); $registerCountList = $userRepository->getRegisterCountGroupByDay($params); @@ -3636,7 +3642,7 @@ public function iosDetailExcelInfo($id,$map) { 'newPayUserCount' => $newPayUserCountList[$day], 'payAmount' => number_format($payAmountList[$day], 2), 'newPayAmount' => number_format($newPayAmountList[$day], 2), - 'historyPayCount' => $historyPayCountList[$day], + // 'historyPayCount' => $historyPayCountList[$day], 'loginCount' => $loginCountList[$day], 'registerCount' => $registerCountList[$day], 'payRate' => $loginCountList[$day] == 0 ? '--' : round($payUserCountList[$day] / $loginCountList[$day] * 100, 2) . '%',