浏览代码

Merge branch 'master' of iqiyoo:zhuishuyun_wap

onlinetest 6 年之前
父节点
当前提交
879142c70e

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

@@ -944,14 +944,14 @@ 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');
+            $exist = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH_V2');
             if ($exist) return true;
             if ($exist) return true;
             if(!UserMonthService::isSignMonth($openid)){
             if(!UserMonthService::isSignMonth($openid)){
                 $attach = $this->uid %2 == 0 ? 'show':'hide';
                 $attach = $this->uid %2 == 0 ? 'show':'hide';
                 DataAnalysisSelectUserService::create(
                 DataAnalysisSelectUserService::create(
                     $this->uid,
                     $this->uid,
                     $this->distribution_channel_id,
                     $this->distribution_channel_id,
-                    'MONTH',
+                    'MONTH_V2',
                     -1, $attach);
                     -1, $attach);
             }
             }
         }
         }

+ 15 - 5
app/Http/Controllers/Wap/User/CoflController.php

@@ -349,25 +349,31 @@ class CoflController extends Controller
      * @return array
      * @return array
      */
      */
     private function getUsersV2($openid){
     private function getUsersV2($openid){
-        $friend_link_uid_bind = DB::table('friend_link_uid_bind')->where('openid',$openid)->first();
+        $friend_link_uid_bind = DB::table('friend_link_uid_bind')->where('openid',$openid)->orderBy('id','desc')->first();
         if($friend_link_uid_bind) {
         if($friend_link_uid_bind) {
             $user = User::where('id',$friend_link_uid_bind->uid)->select('id','distribution_channel_id')->first();
             $user = User::where('id',$friend_link_uid_bind->uid)->select('id','distribution_channel_id')->first();
             if($user) {
             if($user) {
-                \Log::info('user;'.json_encode($user));
-
                 return [$user->id,$user->distribution_channel_id];
                 return [$user->id,$user->distribution_channel_id];
             }
             }
         }
         }
         //外部渠道导粉
         //外部渠道导粉
-        if(Redis::Hexists('crm:out_guide_exposure_user',$openid)){
+        if(Redis::hget('crm:out_guide_exposure_user',$openid)){
+            Log::info('------------getUsersV2-outer---start--------------------------------');
+            Log::info('getUsersV2 $openid is:'.$openid);
             $user = $this->createUser($openid,$openid,5204,0,'');
             $user = $this->createUser($openid,$openid,5204,0,'');
+            Log::info('$user = $this->createUser($openid,$openid,5204,0):');
+            Log::info($user);
             $uid = $user->id;
             $uid = $user->id;
             $distribution_channel_id = 5204;
             $distribution_channel_id = 5204;
             $ouid = Redis::hget('crm:out_guide_exposure_user',$openid);
             $ouid = Redis::hget('crm:out_guide_exposure_user',$openid);
+            Log::info('$ouid is :'.$ouid);
             UserService::transfer($ouid,$uid,5204);
             UserService::transfer($ouid,$uid,5204);
             $insert_data = ['uid'=>$uid,'openid'=>$openid ,'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
             $insert_data = ['uid'=>$uid,'openid'=>$openid ,'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
             DB::table('friend_link_uid_bind')->insert($insert_data);
             DB::table('friend_link_uid_bind')->insert($insert_data);
-            Redis::del('crm:out_guide_exposure_user',$openid);
+
+            Redis::hdel('crm:out_guide_exposure_user',$openid);
+            Log::info([$uid,$distribution_channel_id]);
+            Log::info('------------getUsersV2-outer---end--------------------------------');
             return [$uid,$distribution_channel_id];
             return [$uid,$distribution_channel_id];
         }
         }
         $inner_channels = Channel::join('channel_users','channel_users.id','=','distribution_channels.channel_user_id')
         $inner_channels = Channel::join('channel_users','channel_users.id','=','distribution_channels.channel_user_id')
@@ -921,6 +927,10 @@ class CoflController extends Controller
     }
     }
 
 
     private function createUser($openid,$unionid,$distribution_channel_id,$send_order_id,$ip){
     private function createUser($openid,$unionid,$distribution_channel_id,$send_order_id,$ip){
+        $user = UserService::getUserByOpenidAndChannelId($openid,$distribution_channel_id);
+        if($user){
+            return $user;
+        }
         $user = null;
         $user = null;
         try{
         try{
             $user =  UserService::addUser(
             $user =  UserService::addUser(

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

@@ -2264,7 +2264,7 @@ class WelcomeController extends BaseController
         $property = $this->property;
         $property = $this->property;
         if (!$property) return '';
         if (!$property) 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')))){
-            $info = DataAnalysisSelectUserService::getByUidAndType($this->uid,'MONTH');
+            $info = DataAnalysisSelectUserService::getByUidAndType($this->uid,'MONTH_V2');
             if($info){
             if($info){
                 if($info->attach == 'show'){
                 if($info->attach == 'show'){
                     return [
                     return [
@@ -2281,12 +2281,32 @@ class WelcomeController extends BaseController
             && in_array($property, ['none','low', 'medium'])
             && in_array($property, ['none','low', 'medium'])
         ) {
         ) {
             if(!UserMonthService::isSignMonth($openid)){
             if(!UserMonthService::isSignMonth($openid)){
-                return [
-                    'price'=>'30元',
-                    'text' => '30元包月 全站万本精彩小说免费看',
-                    'link'=> generateMonthOrderUrl($this->uid)
-                    //'link'=> '/rmonthpay'
-                ];
+                $start_time = redisEnv('MONTH_TEMPLATE_COMPARE_START_TIME', 0);
+                if($start_time){
+                    if (strtotime($this->user->created_at) < $start_time) {
+                        return '';
+                    }else{
+                        $attach = $this->uid %2 == 0 ? 'show':'hide';
+                        if($attach == 'show'){
+                            return [
+                                'price'=>'30元',
+                                'text' => '30元包月 全站万本精彩小说免费看',
+                                'link'=> generateMonthOrderUrl($this->uid)
+                                //'link'=> '/rmonthpay'
+                            ];
+                        }else{
+                            return '';
+                        }
+                    }
+                }else{
+                    return [
+                        'price'=>'30元',
+                        'text' => '30元包月 全站万本精彩小说免费看',
+                        'link'=> generateMonthOrderUrl($this->uid)
+                        //'link'=> '/rmonthpay'
+                    ];
+                }
+
             }
             }
         }
         }
         return '';
         return '';

+ 1 - 1
resources/views/wap-browser/template.blade.php

@@ -9,12 +9,12 @@
    {{-- <meta http-equiv="X-UA-Compatible" content="ie=edge">--}}
    {{-- <meta http-equiv="X-UA-Compatible" content="ie=edge">--}}
     <title>{{$title}}</title>
     <title>{{$title}}</title>
     <link href="/wapbrowser/web/base.css" rel="stylesheet">
     <link href="/wapbrowser/web/base.css" rel="stylesheet">
+    <script src="/wapbrowser/web/refreshRem.js"></script>
     @yield('head')
     @yield('head')
 </head>
 </head>
 <body>
 <body>
 @yield('body')
 @yield('body')
 @yield('foot')
 @yield('foot')
-<script src="/wapbrowser/web/refreshRem.js"></script>
 <script>
 <script>
     var _hmt = _hmt || [];
     var _hmt = _hmt || [];
     (function() {
     (function() {