zz 5 år sedan
förälder
incheckning
b044f9c1cf

+ 30 - 1
app/Http/Controllers/Wap/Order/OrdersController.php

@@ -266,7 +266,8 @@ class OrdersController extends BaseController
 
         $property = UserDivisionCpcPropertyService::getUserPropertyV2($this->uid);
         $user_info = $this->_user_info;
-        $this->monthPayExposureRecord($property,$user_info->openid);
+        //$this->monthPayExposureRecord($property,$user_info->openid);
+        $this->monthAbTest($property,$user_info->openid);
         foreach ($res as $v) {
             if ($template_id == 7 && $book_config && $book_config->charge_type == 'BOOK' && $v->price == 2) {
                 continue;
@@ -928,4 +929,32 @@ class OrdersController extends BaseController
         }
         return '';
     }
+
+    private function monthAbTest($property,$openid){
+        $start_time = redisEnv('MONTH_TEMPLATE_COMPARE_START_TIME', 0);
+        if (!$start_time) {
+            return 0;
+        }
+
+        $user = $this->_user_info;
+        if (strtotime($user->created_at) < $start_time) {
+            return 0;
+        }
+
+        if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
+            && in_array($property, ['none','low', 'medium'])
+        ) {
+            $exist = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH');
+            if ($exist) return true;
+            if(!UserMonthService::isSignMonth($openid)){
+                $attach = $this->uid %2 == 0 ? 'show':'hide';
+                DataAnalysisSelectUserService::create(
+                    $this->uid,
+                    $this->distribution_channel_id,
+                    'MONTH',
+                    -1, $attach);
+            }
+        }
+        return '';
+    }
 }

+ 14 - 0
app/Http/Controllers/Wap/Web/WelcomeController.php

@@ -2253,6 +2253,20 @@ class WelcomeController extends BaseController
     private function monthOrderInfo($openid){
         $property = $this->property;
         if (!$property) return '';
+        if(in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))){
+            $info = DataAnalysisSelectUserService::getByUidAndType($this->uid,'MONTH');
+            if($info){
+                if($info->attach == 'show'){
+                    return [
+                        'price'=>'30元',
+                        'text' => '30元包月 全站万本精彩小说免费看',
+                        'link'=> generateMonthOrderUrl($this->uid)
+                        //'link'=> '/rmonthpay'
+                    ];
+                }
+                return [];
+            }
+        }
         if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
             && in_array($property, ['none','low', 'medium'])
         ) {