Bladeren bron

month pay debug

zz 5 jaren geleden
bovenliggende
commit
4dcffad73f

+ 28 - 20
app/Http/Controllers/Wap/Order/OrdersController.php

@@ -270,6 +270,7 @@ class OrdersController extends BaseController
         /*$result = $this->monthAbTest($property,$user_info->openid);
         /*$result = $this->monthAbTest($property,$user_info->openid);
         if($result == 0){$this->monthPayExposureRecord($property,$user_info->openid);}
         if($result == 0){$this->monthPayExposureRecord($property,$user_info->openid);}
         $this->monthPayExposureRecordOther();*/
         $this->monthPayExposureRecordOther();*/
+        $this->monthAbTest($property,'');
         foreach ($res as $v) {
         foreach ($res as $v) {
             if ($template_id == 7 && $book_config && $book_config->charge_type == 'BOOK' && $v->price == 2) {
             if ($template_id == 7 && $book_config && $book_config->charge_type == 'BOOK' && $v->price == 2) {
                 continue;
                 continue;
@@ -973,35 +974,42 @@ class OrdersController extends BaseController
         if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
         if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
             && in_array($property, ['none','low', 'medium'])
             && in_array($property, ['none','low', 'medium'])
         ) {
         ) {
-            $exist = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH_V2');
+            $exist = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH_V3');
             if ($exist) {
             if ($exist) {
                 $attach = $exist->attach;
                 $attach = $exist->attach;
-                if($attach == 'week-show' || $attach == 'show'){
+                if($attach == 'show'){
                     $ret = 0;
                     $ret = 0;
+                    DB::table('user_month_visit_record')->insert([
+                        'uid'=>$this->uid,'day'=>date('Y-m-d'),
+                        'type'=>'QUARTER',
+                        'created_at'=>date('Y-m-d H:i:s'),
+                        'updated_at'=>date('Y-m-d H:i:s')
+                    ]);
                 }else{
                 }else{
                     $ret = -1;
                     $ret = -1;
                 }
                 }
                 return $ret;
                 return $ret;
             }
             }
-            if(!UserMonthService::isSignMonth($openid)){
-                if($property == 'nonenone'){
-                    $attach = $this->uid %2 == 0 ? 'week-show':'week-hide';
-                }else{
-                    $attach = $this->uid %2 == 0 ? 'show':'hide';
-                }
-                if($attach == 'week-show' || $attach == 'show'){
-                    $ret = 0;
-                }else{
-                    $ret = -1;
-                }
-
-                DataAnalysisSelectUserService::create(
-                    $this->uid,
-                    $this->distribution_channel_id,
-                    'MONTH_V2',
-                    -1, $attach);
-                return $ret;
+            $attach = $this->uid %2 == 0 ? 'show':'hide';
+            if($attach == 'show'){
+                $ret = 0;
+                DB::table('user_month_visit_record')->insert([
+                    'uid'=>$this->uid,'day'=>date('Y-m-d'),
+                    'type'=>'QUARTER',
+                    'created_at'=>date('Y-m-d H:i:s'),
+                    'updated_at'=>date('Y-m-d H:i:s')
+                ]);
+            }else{
+                $ret = -1;
             }
             }
+
+            DataAnalysisSelectUserService::create(
+                $this->uid,
+                $this->distribution_channel_id,
+                'MONTH_V3',
+                -1, $attach);
+            return $ret;
+
         }
         }
         return -1;
         return -1;
     }
     }

+ 20 - 76
app/Http/Controllers/Wap/Web/WelcomeController.php

@@ -2379,10 +2379,9 @@ class WelcomeController extends BaseController
 
 
     private function monthOrderInfo($openid)
     private function monthOrderInfo($openid)
     {
     {
-        return '';
         $property = $this->property;
         $property = $this->property;
         if (!$property) return '';
         if (!$property) return '';
-        $month_info = UserMonthService::getOrderAndSignStatusByUid($this->uid);
+        /*$month_info = UserMonthService::getOrderAndSignStatusByUid($this->uid);
         if($month_info){
         if($month_info){
             return [
             return [
                 'price' => '30元',
                 'price' => '30元',
@@ -2391,93 +2390,38 @@ class WelcomeController extends BaseController
                 'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
                 'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
                 'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
                 'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
             ];
             ];
-            /*if(in_array('MONTH',$month_info)){
-                return [
-                    'price' => '30元',
-                    'text' => '30元包月 全站万本精彩小说免费看',
-                    'link' => generateMonthOrderUrl($this->uid),
-                    'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
-                    'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
-                ];
-            }
-            if(in_array('WEEK',$month_info)){
-                return [
-                    'price' => '7元',
-                    'text' => '7元包周 全站万本精彩小说免费看',
-                    'link' => generateMonthOrderUrlV2($this->uid, env('MONTH_WEEK_ORDER_PLAN_ID'), _getIp()),
-                    'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-2.png',
-                    'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-1.png'
-                ];
-            }*/
-        }
+        }*/
         if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))) {
         if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))) {
-            $info = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH_V2');
+            $info = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH_V3');
             if ($info) {
             if ($info) {
-                if ($info->attach == 'show' || $info->attach == 'week-show') {
+                if ($info->attach == 'show') {
                     return [
                     return [
-                        'price' => '30元',
-                        'text' => '30元包月 全站万本精彩小说免费看',
-                        'link' => generateMonthOrderUrl($this->uid),
+                        'price' => '98元',
+                        'text' => '98元包季 全站万本精彩小说免费看',
+                        'link' => \App\Modules\User\Services\UserMonthService::monthOrderLink($this->uid,env('MONTH_QUARTER_ORDER_PLAN_ID')),
                         'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
                         'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
                         'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
                         'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
                     ];
                     ];
                 }
                 }
-                /*if ($info->attach == 'week-show') {
-                    return [
-                        'price' => '7元',
-                        'text' => '7元包周 全站万本精彩小说免费看',
-                        'link' => generateMonthOrderUrlV2($this->uid, env('MONTH_WEEK_ORDER_PLAN_ID'), _getIp()),
-                        'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-2.png',
-                        'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-1.png'
-                    ];
-                }*/
                 return '';
                 return '';
             }
             }
         }
         }
         if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
         if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
             && in_array($property, ['none', 'low', 'medium'])
             && in_array($property, ['none', 'low', 'medium'])
         ) {
         ) {
-            if (!UserMonthService::isSignMonth($openid)) {
-                $start_time = redisEnv('MONTH_TEMPLATE_COMPARE_START_TIME', 0);
-                if (!$start_time || (strtotime($this->user->created_at) < $start_time)) {
-                    if ($property == 'nonenone') {
-                        return [
-                            'price' => '7元',
-                            'text' => '7元包周 全站万本精彩小说免费看',
-                            'link' => generateMonthOrderUrlV2($this->uid, env('MONTH_WEEK_ORDER_PLAN_ID'), _getIp()),
-                            'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-2.png',
-                            'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-1.png'
-                        ];
-                    } else {
-                        return [
-                            'price' => '30元',
-                            'text' => '30元包月 全站万本精彩小说免费看',
-                            'link' => generateMonthOrderUrl($this->uid),
-                            'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
-                            'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
-                        ];
-                    }
-                }
-                $attach = $this->uid % 2 == 0 ? 'show' : 'hide';
-                if ($attach == 'hide') return '';
-                if ($property == 'nonenone') {
-                    return [
-                        'price' => '7元',
-                        'text' => '7元包周 全站万本精彩小说免费看',
-                        'link' => generateMonthOrderUrlV2($this->uid, env('MONTH_WEEK_ORDER_PLAN_ID'), _getIp()),
-                        'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-2.png',
-                        'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/week-order-1.png'
-                    ];
-                } else {
-                    return [
-                        'price' => '30元',
-                        'text' => '30元包月 全站万本精彩小说免费看',
-                        'link' => generateMonthOrderUrl($this->uid),
-                        'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
-                        'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
-                    ];
-                }
-            }
+            $start_time = redisEnv('MONTH_TEMPLATE_COMPARE_START_TIME', 0);
+            if(!$start_time || (strtotime($this->user->created_at) < $start_time )) return '';
+
+            $attach = $this->uid % 2 == 0 ? 'show' : 'hide';
+            if ($attach == 'hide') return '';
+            return [
+                'price' => '98元',
+                'text' => '98元包季 全站万本精彩小说免费看',
+                'link' => \App\Modules\User\Services\UserMonthService::monthOrderLink($this->uid,env('MONTH_QUARTER_ORDER_PLAN_ID')),
+                'focus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_check.png',
+                'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
+            ];
+
         }
         }
         return '';
         return '';
     }
     }