|
|
@ -29,6 +29,7 @@ class PackageController extends Controller
|
|
|
|
public function download()
|
|
|
|
public function download()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$code = I('code', '');
|
|
|
|
$code = I('code', '');
|
|
|
|
|
|
|
|
$force = I('force', '');
|
|
|
|
$gameId = I('game_id', 0);
|
|
|
|
$gameId = I('game_id', 0);
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
|
|
|
|
|
|
|
@ -77,11 +78,11 @@ class PackageController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find();
|
|
|
|
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find();
|
|
|
|
|
|
|
|
|
|
|
|
if (Request::isMobile() || Request::isTablet()) {
|
|
|
|
if (Request::isMobile() || Request::isTablet() || $force == 'ios' || $force == 'android') {
|
|
|
|
if (!Request::isAndroid() && $game['sdk_version'] == 1) {
|
|
|
|
if (!(Request::isAndroid() || $force == 'android') && $game['sdk_version'] == 1) {
|
|
|
|
$this->redirect("package/downloadError", ['message' => '请使用安卓浏览器下载']);
|
|
|
|
$this->redirect("package/downloadError", ['message' => '请使用安卓浏览器下载']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!(Request::isIOS() || Request::isIPadOS()) && $game['sdk_version'] == 2) {
|
|
|
|
if (!(Request::isIOS() || Request::isIPadOS() || $force == 'ios') && $game['sdk_version'] == 2) {
|
|
|
|
$this->redirect("package/downloadError", ['message' => '请使用ios浏览器下载']);
|
|
|
|
$this->redirect("package/downloadError", ['message' => '请使用ios浏览器下载']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -104,7 +105,7 @@ class PackageController extends Controller
|
|
|
|
M('user_action_log', 'tab_')->data($log)->add();
|
|
|
|
M('user_action_log', 'tab_')->data($log)->add();
|
|
|
|
|
|
|
|
|
|
|
|
$downloadDomain = $applyService->getDownloadDomain();
|
|
|
|
$downloadDomain = $applyService->getDownloadDomain();
|
|
|
|
if (Request::isIOS() || Request::isIPadOS()) {
|
|
|
|
if (Request::isIOS() || Request::isIPadOS() || $force == 'ios') {
|
|
|
|
$packageDownloadLogService = new PackageDownloadLogService();
|
|
|
|
$packageDownloadLogService = new PackageDownloadLogService();
|
|
|
|
$packageDownloadLogService->add([
|
|
|
|
$packageDownloadLogService->add([
|
|
|
|
'user_id' => 0,
|
|
|
|
'user_id' => 0,
|
|
|
|