瀏覽代碼

default charge template

zz 6 年之前
父節點
當前提交
ce3d7a1591

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

@@ -1757,7 +1757,7 @@ class ChapterController extends BaseController
         if(!$ad_status){
             return ;
         }
-        if(!in_array($this->distribution_channel_id,[2,5,14,8,123,146,148,155,160,196,202,211,255,256,266,271,273,318,691,722,4053,4236,4237,4241,4334,4364,4427,4487,4488])){
+        if(!in_array($this->distribution_channel_id,[5,8,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])){
             return ;
         }
         //按章付费才显示

+ 6 - 0
app/Modules/Channel/Services/PayTemplateService.php

@@ -9,6 +9,7 @@
 namespace App\Modules\Channel\Services;
 
 use App\Modules\Channel\Models\PayTemplate;
+use App\Modules\OfficialAccount\Models\OfficialAccount;
 
 class PayTemplateService
 {
@@ -18,6 +19,11 @@ class PayTemplateService
      * @return int
      */
     public static function getPayTemplate(int $distribution_channel_id){
+        //没有授权服务号的站点 充值模板默认是1
+        $offical = OfficialAccount::where('distribution_channel_id',$distribution_channel_id)->where('is_auth',1)->count();
+        if(!$offical){
+            return 1;
+        }
         $res = PayTemplate::where('distribution_channel_id',$distribution_channel_id)->select('product_template_type')->first();
         $template_type = 2;
         if($res){