فهرست منبع

after 16 clock, inner send order do not force subscribe

zz 6 سال پیش
والد
کامیت
57e00d1748
1فایلهای تغییر یافته به همراه12 افزوده شده و 3 حذف شده
  1. 12 3
      app/Http/Controllers/Wap/Book/ChapterController.php

+ 12 - 3
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -1093,9 +1093,12 @@ class ChapterController extends BaseController
      */
     protected function getSubscribe()
     {
-        if($this->send_order_id &&
-            in_array($this->distribution_channel_id,explode(',',env('INNER_CHANNEL_SUB','1'))) &&
-            ($send_order_info = SendOrderService::getById($this->send_order_id)) &&
+        $send_order_info = null;
+        if($this->send_order_id){
+            $send_order_info = SendOrderService::getById($this->send_order_id);
+        }
+        if(in_array($this->distribution_channel_id,explode(',',env('INNER_CHANNEL_SUB','1'))) &&
+            $send_order_info &&
             $send_order_info->promotion_type == 'EXTERNAL'
         ){
             $subscribe_info = ForceSubscribeUserIService::subscribes($this->uid,$this->distribution_channel_id,$this->send_order_id);
@@ -1103,6 +1106,12 @@ class ChapterController extends BaseController
             $this->need_subscribe_name = $subscribe_info['name'];
             return $subscribe_info['is_subscribed'];
         }
+
+        if($send_order_info &&
+            $send_order_info->promotion_type == 'INTERNAL' &&
+            strtotime($send_order_info->created_at) > 1555315200){
+            return true;
+        }
         $res = ForceSubscribeService::forceSubscribeUsersByUid(['uid' => $this->uid]);
         if ($res) {
             $this->force_subscribe_time = isset($res->created_at)?$res->created_at:null;