zz 6 سال پیش
والد
کامیت
caf8f38618
2فایلهای تغییر یافته به همراه11 افزوده شده و 3 حذف شده
  1. 2 1
      app/Http/Controllers/Wap/Book/ChapterController.php
  2. 9 2
      app/Http/Controllers/Wap/Web/WelcomeController.php

+ 2 - 1
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -1798,7 +1798,8 @@ class ChapterController extends BaseController
         if(!$this->is_had_subscribe){
             return ;
         }
-        if(!in_array($this->distribution_channel_id,[2,5,8,14,123,146,148,155,160,196,202,211,255,256,266,271,273,318,691,695,722,4025,4053,4174,4236,4237,4241,4334,4364,4426,4427,4487,4488,4593,4742,4889,4891,5204])){
+        //if(!in_array($this->distribution_channel_id,[2,5,8,14,123,146,148,155,160,196,202,211,255,256,266,271,273,318,691,695,722,4025,4053,4174,4236,4237,4241,4334,4364,4426,4427,4487,4488,4593,4742,4889,4891,5204])){
+        if(! Redis::hget('channel:setting:'.$this->distribution_channel_id,'cpc_status')){
             return ;
         }
         //按章付费才显示

+ 9 - 2
app/Http/Controllers/Wap/Web/WelcomeController.php

@@ -104,6 +104,11 @@ class WelcomeController extends BaseController
         if ($ad_status) {
             $adTargetId = $this->cpcAd($user->openid);
         }
+        $cpc_channel = '';
+        if($adTargetId){
+            $cpc_channel = Redis::hget('channel:setting:'.$this->distribution_channel_id,'cpc_channel');
+            if(!$cpc_channel) $cpc_channel = false;
+        }
         //广告frame
         $is_show_ad_frame_setting = env('IS_SHOW_AD_FRAME_SETTING', '123');
         $is_show_ad_frame = false;
@@ -190,7 +195,8 @@ class WelcomeController extends BaseController
             'pdd_ad'=>$pdd_ad,
             'special_pay_template'=>$this->isMiWan(),  //米玩站点特殊充值页面
             'crm'=>$crm,
-            'guidepersonalaccount'=>$this->guidePersonalAccount()
+            'guidepersonalaccount'=>$this->guidePersonalAccount(),
+            'cpc_channel'=>$cpc_channel
         ]);
         if ($this->uid == env('SPECIAL_USER_LOG', 2)) {
             myLog('special')->info('welcome --------------------------');
@@ -524,7 +530,8 @@ class WelcomeController extends BaseController
 
     //CPC广告的优化逻辑
     private function cpcAd($openid){
-        if(in_array($this->distribution_channel_id,[2,5,8,14,123,146,148,155,160,196,202,211,255,256,266,271,273,318,691,695,722,4025,4053,4174,4236,4237,4241,4334,4364,4426,4427,4487,4488,4593,4742,4889,4891,5204])){
+        //if(in_array($this->distribution_channel_id,[2,5,8,14,123,146,148,155,160,196,202,211,255,256,266,271,273,318,691,695,722,4025,4053,4174,4236,4237,4241,4334,4364,4426,4427,4487,4488,4593,4742,4889,4891,5204])){
+        if(Redis::hget('channel:setting:'.$this->distribution_channel_id,'cpc_status')){
             $cookie_ad_status = Cookie::get('cpc_ad_status');
             if($cookie_ad_status) return $cookie_ad_status == 'show';
             $property = UserDivisionCpcPropertyService::userLevel($openid);