From 9a25fd0a04f8c94c258b0070063f8fad4932c7fa Mon Sep 17 00:00:00 2001 From: liaojinling <360197197@qq.com> Date: Sat, 30 Nov 2019 10:28:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/ApplyController.class.php | 12 ++++++++++-- Application/Home/View/default/Apply/my_game.html | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index 374ae8d03..18b02e1b3 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -1756,8 +1756,12 @@ class ApplyController extends BaseController public function getDownloadUrl() { $gameId = I('game_id', 0); + $promoteId = I('promote_id', 0); $promote = $this->getLoginPromote(); - $apply = M('apply', 'tab_')->where(['promote_id' => $promote['id'], 'game_id' => $gameId])->find(); + if ($promoteId == 0) { + $promoteId = $promote['id']; + } + $apply = M('apply', 'tab_')->where(['promote_id' => $promoteId, 'game_id' => $gameId])->find(); $game = M('game', 'tab_')->field(['icon'])->where(['id' => $gameId])->find(); if ($apply == null) { $this->ajaxReturn([ @@ -1793,8 +1797,12 @@ class ApplyController extends BaseController public function getLandingPageUrl() { $gameId = I('game_id', 0); + $promoteId = I('promote_id', 0); $promote = $this->getLoginPromote(); - $apply = M('apply', 'tab_')->where(['promote_id' => $promote['id'], 'game_id' => $gameId])->find(); + if ($promoteId == 0) { + $promoteId = $promote['id']; + } + $apply = M('apply', 'tab_')->where(['promote_id' => $promoteId, 'game_id' => $gameId])->find(); $game = M('game', 'tab_')->field(['icon'])->where(['id' => $gameId])->find(); if ($apply == null) { $this->ajaxReturn([ diff --git a/Application/Home/View/default/Apply/my_game.html b/Application/Home/View/default/Apply/my_game.html index 33dff8572..36764e55b 100644 --- a/Application/Home/View/default/Apply/my_game.html +++ b/Application/Home/View/default/Apply/my_game.html @@ -837,6 +837,7 @@ var linkTag = this var gameId = parseInt($(this).attr('data-game-id')) var type = $(this).attr('data-type') + var promoteId = "{:I('promote_id', 0)}"; var url = '' if (type == 'download') { url = "__URL__/getDownloadUrl" @@ -847,7 +848,7 @@ url: url, type: 'post', dataType: "json", - data: {game_id: gameId}, + data: {game_id: gameId, promote_id: promoteId}, success: function (response) { if (response.status == 1) { var qrcodeWidth = 200