浏览代码

Merge branch 'stabble' of iqiyoo:zhuishuyun_wap into stabble

songdb 5 年之前
父节点
当前提交
657d2e9013

+ 2 - 2
app/Http/Controllers/Wap/Order/OrdersController.php

@@ -942,7 +942,7 @@ class OrdersController extends BaseController
         ) {
             if(!UserMonthService::isSignMonth($openid)){
                 try{
-                    if(in_array($property,['low','medium'])){
+                    if(in_array($property,['low','medium','none'])){
                         $type = 'MONTH';
                     }else{
                         $type = 'WEEK';
@@ -984,7 +984,7 @@ class OrdersController extends BaseController
                 return $ret;
             }
             if(!UserMonthService::isSignMonth($openid)){
-                if($property == 'none'){
+                if($property == 'nonenone'){
                     $attach = $this->uid %2 == 0 ? 'week-show':'week-hide';
                 }else{
                     $attach = $this->uid %2 == 0 ? 'show':'hide';

+ 23 - 4
app/Http/Controllers/Wap/User/CrmBooklistController.php

@@ -14,6 +14,7 @@ class CrmBooklistController extends Controller
     public function index(Request $request)
     {
         $month = date('n');
+        $this->statsDetail($this->getUserColumnValue('id'),'entrance');
         return view('crm.entrance')->with(compact('month'));
     }
 
@@ -28,11 +29,12 @@ class CrmBooklistController extends Controller
                 $books = collect($item)->sortByDesc('recommend_index')->values()->transform(function ($item) {
                     $item['star'] =  intval(($item['recommend_index'] - 50) / 10);
                     $item['link'] = sprintf(
-                        '%s://site%s.%s.com/detail?id=%s',
+                        '%s://site%s.%s.com/detail?id=%s&crm=%s',
                         env('PROTOCOL'),
                         encodeDistributionChannelId($this->getUserColumnValue('channel_id')),
                         env('CUSTOM_HOST'),
-                        Hashids::encode($item['bid'])
+                        Hashids::encode($item['bid']),
+                        'crm_book_show_'.$item['bid']
                     );
                     return $item;
                 })->take(4)->all();
@@ -40,6 +42,7 @@ class CrmBooklistController extends Controller
             })->all();
         $annually_monthly_user = new AnnuallyMonthlyUser();
         $is_annually_monthly_user = $annually_monthly_user->is_monthly || $annually_monthly_user->is_annually;
+        $this->statsDetail($this->getUserColumnValue('id'),'bookshow');
         return view('crm.bookshow')->with(compact('book_models','is_annually_monthly_user'));
     }
 
@@ -52,15 +55,17 @@ class CrmBooklistController extends Controller
             $booklists = (new CrmBookAutoRecommendService)->getRecommendBooksFromRedis();
             $books =  collect($booklists)->where('category_id', $category_id)->transform(function ($item) {
                 $item['link'] = sprintf(
-                    '%s://site%s.%s.com/detail?id=%s',
+                    '%s://site%s.%s.com/detail?id=%s&crm=%s',
                     env('PROTOCOL'),
                     encodeDistributionChannelId($this->getUserColumnValue('channel_id')),
                     env('CUSTOM_HOST'),
-                    Hashids::encode($item['bid'])
+                    Hashids::encode($item['bid']),
+                    'crm_book_list_'.$item['bid']
                 );
                 return $item;
             })->all();
         }
+        $this->statsDetail($this->getUserColumnValue('id'),'booklist');
         return view('crm.booklist', compact('books', 'month')); #->with(compact('books', 'month'));
     }
 
@@ -71,4 +76,18 @@ class CrmBooklistController extends Controller
             return $user->$column;
         }
     }
+
+
+    private function statsDetail($uid,$page,$bid=0)
+    {
+        try{
+            DB::table('crm_visit_detail')->insert([
+                'uid'=>$uid,'page'=>$page,
+                'bid'=>$bid,'day'=>date('Y-m-d'),
+                'created_at'=>date('Y-m-d H:i:s'),
+                'updated_at'=>date('Y-m-d H:i:s')
+            ]);
+        }catch (\Exception $e){}
+
+    }
 }

+ 16 - 7
app/Http/Controllers/Wap/Web/WelcomeController.php

@@ -2233,6 +2233,8 @@ class WelcomeController extends BaseController
         //渠道自己导粉
         $other_crm_config = Redis::hmget('channel:setting:' . $this->distribution_channel_id, ['crm_status', 'crm_link']);
         if (empty($other_crm_config[0]) && empty($other_crm_config[1])) return '';
+        $get_info = UserBindHkWelfareService::isHasGet($this->uid);
+        if ($get_info) return '';
         if($this->is_paid || $this->distribution_channel_id == 6687)
             return ['title' => '点击领取200书币>>', 'link' => $other_crm_config[1]];
         return '';
@@ -2367,7 +2369,14 @@ class WelcomeController extends BaseController
         if (!$property) return '';
         $month_info = UserMonthService::getOrderAndSignStatusByUid($this->uid);
         if($month_info){
-            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('MONTH',$month_info)){
                 return [
                     'price' => '30元',
                     'text' => '30元包月 全站万本精彩小说免费看',
@@ -2384,12 +2393,12 @@ class WelcomeController extends BaseController
                     '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')))) {
             $info = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH_V2');
             if ($info) {
-                if ($info->attach == 'show') {
+                if ($info->attach == 'show' || $info->attach == 'week-show') {
                     return [
                         'price' => '30元',
                         'text' => '30元包月 全站万本精彩小说免费看',
@@ -2398,7 +2407,7 @@ class WelcomeController extends BaseController
                         'unfocus_img'=>'https://cdn-novel.iycdm.com/h5/monthpay/month_order_1.png'
                     ];
                 }
-                if ($info->attach == 'week-show') {
+                /*if ($info->attach == 'week-show') {
                     return [
                         'price' => '7元',
                         'text' => '7元包周 全站万本精彩小说免费看',
@@ -2406,7 +2415,7 @@ class WelcomeController extends BaseController
                         '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 '';
             }
         }
@@ -2416,7 +2425,7 @@ class WelcomeController extends BaseController
             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 == 'none') {
+                    if ($property == 'nonenone') {
                         return [
                             'price' => '7元',
                             'text' => '7元包周 全站万本精彩小说免费看',
@@ -2436,7 +2445,7 @@ class WelcomeController extends BaseController
                 }
                 $attach = $this->uid % 2 == 0 ? 'show' : 'hide';
                 if ($attach == 'hide') return '';
-                if ($property == 'none') {
+                if ($property == 'nonenone') {
                     return [
                         'price' => '7元',
                         'text' => '7元包周 全站万本精彩小说免费看',