From e58bb1149fffc1d65e8ed9d618514d397d2be40b Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 18 Feb 2020 16:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=90=BD=E5=9C=B0=E9=A1=B5?= =?UTF-8?q?=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Service/PromoteService.class.php | 2 +- .../Home/Controller/ApplyController.class.php | 41 +++++++++++++++++-- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index dc8be7cc6..6595b95ab 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1015,7 +1015,7 @@ class PromoteService { if (!$record) { return false; } - if ($record['status'] != 1) { + if (!in_array($record['status'], [1, 2])) { return false; } } diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index ed99d068b..c7cf38695 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -132,6 +132,15 @@ class ApplyController extends BaseController } } break; + case 0: + $applyService = new ApplyService(); + $gameIdList = $applyService->getSociatyGameIds($loginPromote); + if (count($gameIdList) > 0) { + $gameIds = implode(',', $gameIdList); + $map['tab_game.id'] = ['in', $gameIds]; + } else { + $map = '1 = 2'; + } } $page = intval(I('get.p', 0)); @@ -615,8 +624,13 @@ class ApplyController extends BaseController $promoteId = $_REQUEST['promote_id']; } + $applyService = new ApplyService(); + $gameIdList = $applyService->getSociatyGameIds($loginPromote); + $applyMap['promote_id'] = $promoteId; $applyMap['offline_status'] = 0; + $applyMap['game_id'] = ['in', $gameIdList]; + $gameIds = M('Apply', 'tab_')->where($applyMap)->getField('game_id', true); $gameIds = implode(',', $gameIds); @@ -1795,7 +1809,7 @@ class ApplyController extends BaseController $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(); + $game = M('game', 'tab_')->field(['id', 'icon', 'apply_auth'])->where(['id' => $gameId])->find(); if ($apply == null) { $this->ajaxReturn([ 'status' => 0, @@ -1805,6 +1819,16 @@ class ApplyController extends BaseController ]); } + $applyService = new ApplyService(); + if (!$applyService->checkSociatyPerm($promote, $game)) { + $this->ajaxReturn([ + 'status' => 0, + 'message' => '该游戏未授权', + 'data' => [ + ] + ]); + } + $promoteService = new PromoteService(); if (!$promoteService->canPresidentApplyGame($promote)) { $this->ajaxReturn([ @@ -1817,7 +1841,6 @@ class ApplyController extends BaseController $icon = Request::getHost() . '/' . get_cover($game['icon'], 'path'); - $applyService = new ApplyService(); $result = $applyService->checkApplyStatus($apply); if (!$result['status']) { $this->ajaxReturn([ @@ -1847,7 +1870,8 @@ class ApplyController extends BaseController } $apply = M('apply', 'tab_')->where(['promote_id' => $promoteId, 'game_id' => $gameId])->find(); - $game = M('game', 'tab_')->field(['icon'])->where(['id' => $gameId])->find(); + $game = M('game', 'tab_')->field(['icon', 'apply_auth', 'id'])->where(['id' => $gameId])->find(); + if ($apply == null) { $this->ajaxReturn([ 'status' => 1, @@ -1857,6 +1881,16 @@ class ApplyController extends BaseController ]); } + $applyService = new ApplyService(); + if (!$applyService->checkSociatyPerm($promote, $game)) { + $this->ajaxReturn([ + 'status' => 0, + 'message' => '该游戏未授权', + 'data' => [ + ] + ]); + } + $promoteService = new PromoteService(); if (!$promoteService->canPresidentApplyGame($promote)) { $this->ajaxReturn([ @@ -1869,7 +1903,6 @@ class ApplyController extends BaseController $icon = Request::getHost() . '/' . get_cover($game['icon'], 'path'); - $applyService = new ApplyService(); $result = $applyService->checkApplyStatus($apply); if (!$result['status']) { $this->ajaxReturn([