Browse Source

template test

zz 6 years ago
parent
commit
66c058fc0a

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

@@ -1291,11 +1291,18 @@ class ChapterController extends BaseController
                 }
             }
         }
-        $template_10_site = redisEnv('TEMPLATE_10_SITE','');
-        if($template_10_site && in_array($this->distribution_channel_id,explode(',',$template_10_site))){
-            if($fee <=37) $fee = 37;
+        //$template_10_site = redisEnv('TEMPLATE_10_SITE','');
+        list($template_10_site,$template_10_no_abtest_site) = redisEnvMulti('TEMPLATE_10_SITE','TEMPLATE_10_NO_AB_TEST_SITE');
+        $start_time = env('TEMPLATE_COMPARE_START_TIME', 0);
+        if($start_time && $template_10_site && in_array($this->distribution_channel_id,explode(',',$template_10_site))){
+            if($this->uid %2 == 0 && strtotime($this->user->created_at) > $start_time){
+                if($fee <37) $fee = 37;
+            }
         }
 
+        if($template_10_no_abtest_site && in_array($this->distribution_channel_id,explode(',',$template_10_no_abtest_site))  ){
+            if($fee <37) $fee = 37;
+        }
         return $fee;
     }
 

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

@@ -243,6 +243,10 @@ class OrdersController extends BaseController
         if( ($comparev2_id = $this->templateCompareV2()) ){
             $template_id = $comparev2_id;
         }
+        $template_10_site = redisEnv('TEMPLATE_10_NO_AB_TEST_SITE','');
+        if($template_10_site && in_array($this->distribution_channel_id,explode(',',$template_10_site))  ){
+            $template_id = 10;
+        }
         $outstandingYearOrder = $this->outstandingYearOrder($this->uid);
         \Log::info('recordFirstIntoPayPage:$template_id:' . $template_id);
         $res = ProductService::getChargeProduct($template_id);
@@ -724,8 +728,16 @@ class OrdersController extends BaseController
                     $this->distribution_channel_id,
                     'TEMPLATE_COMPAREV10',
                     -1, 10);
+                return 10;
+            }else{
+                DataAnalysisSelectUserService::create(
+                    $this->uid,
+                    $this->distribution_channel_id,
+                    'TEMPLATE_COMPAREV10',
+                    -1, 0);
+                return 0;
             }
-            return 10;
+
         }
     }