|
|
|
@ -82,16 +82,17 @@ class PackageController extends Controller
|
|
|
|
|
|
|
|
|
|
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find();
|
|
|
|
|
|
|
|
|
|
$sdkVersion = $game['sdk_version'];
|
|
|
|
|
|
|
|
|
|
if (Request::isMobile() || Request::isTablet() || $force == 'ios' || $force == 'android') {
|
|
|
|
|
if (!(Request::isAndroid() || $force == 'android') && $game['sdk_version'] == 1) {
|
|
|
|
|
$this->redirect("package/downloadError", ['message' => '请使用安卓浏览器下载']);
|
|
|
|
|
}
|
|
|
|
|
if (!(Request::isIOS() || Request::isIPadOS() || $force == 'ios') && $game['sdk_version'] == 2) {
|
|
|
|
|
$this->redirect("package/downloadError", ['message' => '请使用ios浏览器下载']);
|
|
|
|
|
if (Request::isAndroid() || $force == 'android') {
|
|
|
|
|
$sdkVersion = 1;
|
|
|
|
|
} elseif (Request::isIOS() || Request::isIPadOS() || $force == 'ios') {
|
|
|
|
|
$sdkVersion = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$packageUrl = $game['sdk_version'] == 1 ? $apply['pack_url'] : $apply['plist_url'];
|
|
|
|
|
$packageUrl = $sdkVersion == 1 ? $apply['pack_url'] : $apply['plist_url'];
|
|
|
|
|
|
|
|
|
|
$apply = M('apply', 'tab_')->where(['promote_id' => $promoteId, 'game_id' => $gameId])->find();
|
|
|
|
|
$url = $applyService->getLandingPageUrl($apply);
|
|
|
|
|