From 4fe33c546f6b127dc04ef3bb60b6fa8a28b32088 Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Fri, 26 Nov 2021 11:43:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E4=B8=A4=E4=B8=AA=E4=BC=9A?= =?UTF-8?q?=E9=95=BF=E6=8E=A8=E5=B9=BF=E6=9F=90=E6=AC=BE=E6=B8=B8=E6=88=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Service/PromoteService.class.php | 9 ++++- .../Home/Controller/GameController.class.php | 36 +++++++++++++------ .../Home/Controller/HomeController.class.php | 2 +- .../Controller/PackageController.class.php | 2 +- .../Controller/HomeController.class.php | 2 +- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 8ea8ddb67..763af6f7c 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1206,7 +1206,7 @@ class PromoteService { return array_unique(array_merge($historyGameIds, $nowGameIds)); } - public function checkPromoteLimitRule($promote) + public function checkPromoteLimitRule($promote, $gameId = 0) { $accountString = 'wangshuai1,ouyangtianlin,zhangjiayuan02,zhangchuang,huangjian,lixiaojie01,youjinbo01,laijiansen,liutao001,huangdonyu,huangwenlu,qiujinwei,qiucanlon,panhailang,linzilun,xuechonbiao,chenfayun01,pengjun,shenyanwei,wusiju,kechengwei,linruidong,huzhoujian,linzelong,linwei1,zhanghanying,xushiming,linxuchen,zhengchengzhi,yaokaijie,wengyongbang,liaofaqian,zhangqing,liaojunwei,zhangming,zhaoxiaoyi01,zhongkaixin,zhangkaiyu,linwei01,dukunpeng,zhengjianzhou,wengshouxiong,caizhenxing,xiuguanxin,suyuelong,guozhijie,chenzhenghao,zhongyouling,linjian,xuwenye,zhengjinhe,huangyongqing,wangqiaozhen,jiangweihao,lijianfeng01,shaowenhui,huangyuhang,lianglingui,baoxiaohui,heyuming,linwanxi,jiangnan,ouzhijie,liguangcai,lican1,caiwenxin,xianggengyu,songzhibin,jinweiyuan,chenyixing,zhangxiang,denglan,yejiehui,wangbencai,huangzhenhon,liumeifu,xuliuyang,zhengmingquan,huangshengguang,liuweihuang,lixuemeng,xurongcheng,chenzhuo,caixiaodong,linhui,luwenjie,huangyonghao,xuguojin,ningyi01,zhouchongliang,chenshigang,chenyangwen,lijiayu,lanhua,zuojingjing,zhangxingliang,huangxinyu,pujianhao,zhengdongwei,xueyiqiang,lijiawei,tongqiang,huangxirui,wangjinfu,linhao01,chenlinzhi,zengjiawei,lijunjie01,xuwei01,diaowenfeng,guoyinzhen,chenzongda,luwujun,hongye,yangdegao,hehaiwei,zhangyutao,zhengxinyao,wangjunqi,wuyuze,linzejun,yangyunfeng,huangxiaojia,linqianyun,liyao01,huangkai,aihu01,wangshuai,zhangjiayuan01,youjinbo,zhangjiayuan,wengshouxion,ningyi'; $accounts = explode(',', $accountString); @@ -1215,6 +1215,13 @@ class PromoteService { } $topPromote = $this->getTopPromote($promote); + + if (in_array($topPromote['account'], ['zhangle', 'changwanwl'])) { + if (in_array($gameId, [293, 294])) { + return false; + } + } + $rule = M('promote_limit_rules', 'tab_')->where(['promote_id' => $topPromote['id']])->order('created_at desc')->limit(1)->find(); if ($rule) { if ($rule['started_at'] === null && $rule['ended_at'] === null) { diff --git a/Application/Home/Controller/GameController.class.php b/Application/Home/Controller/GameController.class.php index b83e2f43d..e5f872c73 100644 --- a/Application/Home/Controller/GameController.class.php +++ b/Application/Home/Controller/GameController.class.php @@ -2008,13 +2008,13 @@ class GameController extends BaseController ]); } - $promoteService = new PromoteService(); - if (!$promoteService->isPresidentAccess($promote)) { + try { + $this->checkPromoteGameUrl($promote, $gameId); + } catch (\Exception $e) { $this->ajaxReturn([ 'status' => 0, - 'message' => '请联系市场专员开启', - 'data' => [ - ] + 'message' => $e->getMessage(), + 'data' => [] ]); } @@ -2061,13 +2061,13 @@ class GameController extends BaseController ]); } - $promoteService = new PromoteService(); - if (!$promoteService->isPresidentAccess($promote)) { + try { + $this->checkPromoteGameUrl($promote, $gameId); + } catch (\Exception $e) { $this->ajaxReturn([ 'status' => 0, - 'message' => '请联系市场专员开启', - 'data' => [ - ] + 'message' => $e->getMessage(), + 'data' => [] ]); } @@ -2093,4 +2093,20 @@ class GameController extends BaseController ] ]); } + + public function checkPromoteGameUrl($promote, $gameId) + { + $promoteService = new PromoteService(); + if (!$promoteService->isPresidentAccess($promote)) { + throw new \Exception('请联系市场专员开启'); + } + + $topPromote = $promoteService->getTopPromote($promote); + if (in_array($topPromote['account'], ['zhangle', 'changwanwl'])) { + if (in_array($gameId, [293, 294])) { + throw new \Exception('不能推广该游戏'); + } + } + + } } diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index 772243ab9..30327dc32 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -213,7 +213,7 @@ class HomeController extends Controller } $promoteService = new PromoteService(); - if (!$promoteService->checkPromoteLimitRule($promote)) { + if (!$promoteService->checkPromoteLimitRule($promote, $gameId)) { $this->error('链接已失效'); } diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index 187bdb9c3..cf4a970c3 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -65,7 +65,7 @@ class PackageController extends Controller } $promoteService = new PromoteService(); - if (!$promoteService->checkPromoteLimitRule($promote)) { + if (!$promoteService->checkPromoteLimitRule($promote, $gameId)) { $this->error('链接已失效'); } diff --git a/Application/Qrcode/Controller/HomeController.class.php b/Application/Qrcode/Controller/HomeController.class.php index ffea24d6e..15c745f34 100644 --- a/Application/Qrcode/Controller/HomeController.class.php +++ b/Application/Qrcode/Controller/HomeController.class.php @@ -213,7 +213,7 @@ class HomeController extends Controller } $promoteService = new PromoteService(); - if (!$promoteService->checkPromoteLimitRule($promote)) { + if (!$promoteService->checkPromoteLimitRule($promote, $gameId)) { $this->error('链接已失效'); }