浏览代码

Merge branch 'stabble' of iqiyoo:zhuishuyun_wap into stabble

onlinetest 6 年之前
父节点
当前提交
3ff0c34fb5

+ 1 - 7
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -828,9 +828,6 @@ class ChapterController extends BaseController
             return false;
         }
 
-        if(in_array($this->distribution_channel_id,[166])){
-            return ['error_type' => 'WAP_NOT_SUBSCRIBE', 'data' => ['src' => 'http://a.veiyouw.com/replace/uSMJS5Pa1550310949446']];
-        }
         //如果是链接强关,则跳转
         $sub_type = $this->getSubscribeType($officialAccount->appid, $this->book_info->bid);
 
@@ -1226,7 +1223,7 @@ class ChapterController extends BaseController
     private function getSubscribeChapterNum($book)
     {
         $hour = date('G');
-        if($this->send_order_id && $hour <=5 && in_array($this->send_order_id,[392216,392218])){
+        if($this->send_order_id && $hour <=5 && in_array($this->send_order_id,[392216,392218,415200,415212,415163])){
             return 1;
         }
         //派单强关
@@ -1252,9 +1249,6 @@ class ChapterController extends BaseController
     private function isVisitDomainEqualBookDomain($domain)
     {
         $book_domain = $this->book_info->promotion_domain;
-        if(in_array($this->distribution_channel_id,[365,4372])){
-            $book_domain = 'zhuishuyun.com';
-        }
         if ($domain == 'zhuishuyun' && stripos($book_domain, 'leyuee') !== false) {
             return false;
         }

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

@@ -633,29 +633,22 @@ class OrdersController extends BaseController
 
     private function templateCompare(){
         //if(!in_array($this->distribution_channel_id,[2,14,211,155,4427,4488,256,691,146,255,722,4364,5,202,318,4237,266,196,273,4236,148,8,4241,160,271,4053,123,4334,4487,4593,695,4025,4426,4174])){
-        $start_time = env('TEMPLATE_COMPARE_START_TIME_3',0);
+        /*$start_time = env('TEMPLATE_COMPARE_START_TIME_3',0);
         if(!$start_time){
             return 0;
-        }
+        }*/
         if(!in_array($this->distribution_channel_id,[14,123,211,5,8,160,4236,4237,4241,374,243,244,245,320,321,324,337,338,538,539,751,752,753,754,4331,4384,4578,4580,4768,4769,4778,130,163,164,165,166,4126])){
             return 0;
         }
 
-        $user = $this->_user_info;
-        if(strtotime($user->created_at) < $start_time){
+        //$user = $this->_user_info;
+        /*if(strtotime($user->created_at) < $start_time){
             return 0;
-        }
-
+        }*/
+        $template_id = 0;
         $user = DataAnalysisSelectUserService::getByUidAndType($this->uid,'TEMPLATE_COMPARE_V3');
         if($user){
             $template_id = $user->attach;
-        }else{
-            $template_id = $this->uid % 2 == 0? 2:4;
-            DataAnalysisSelectUserService::create(
-                $this->uid,
-                $this->distribution_channel_id,
-                'TEMPLATE_COMPARE_V3',
-                -1, $template_id);
         }
 
         return $template_id;

+ 4 - 0
app/Http/Controllers/Wap/Pay/OrdersController.php

@@ -538,6 +538,10 @@ class OrdersController extends Controller
                 return redirect($url);
             }
         }
+        if(isset($url_info['path']) && str_contains($url_info['path'], 'pay')){
+            $url = sprintf('%s://%s/recent', $url_info['scheme'], $url_info['host']);
+            return redirect($url);
+        }
         return view('pay.order.wait', compact('order', 'url'));
     }
 

+ 9 - 6
app/Http/Middleware/ReadOauth.php

@@ -101,10 +101,10 @@ class ReadOauth
             }
             return redirect()->to($redirect);
         }
-
+        $uri_send_order_id = 0;
         if (strpos($uri, '/yun/') !== false) {
             $uri_send_order_id = (int)str_ireplace('/yun/', '', $uri);
-            Redis::hset('book_read:' . $uid_cookie, 'send_order_id', $uri_send_order_id);
+            //Redis::hset('book_read:' . $uid_cookie, 'send_order_id', $uri_send_order_id);
         }
 
         //个性化推送
@@ -125,7 +125,7 @@ class ReadOauth
              Log::info($user_info);*/
             $back = $request->get('back', '');
             if ($openid && $appid && $distribution_channel_id && $uid_cookie) {
-                $this->apidAndOpenId($distribution_channel_id, $appid, $openid, $uid_cookie);
+                $this->apidAndOpenId($distribution_channel_id, $appid, $openid, $uid_cookie,$uri_send_order_id);
                 $channel = ChannelService::getById($distribution_channel_id);
                 $is_yq_move = $this->isQyMove($channel, $distribution_channel_id);
                 if ($is_yq_move) {
@@ -327,7 +327,7 @@ class ReadOauth
         return $arg;
     }
 
-    private function apidAndOpenId($distribution_channel_id, $appid, $openid, $uid)
+    private function apidAndOpenId($distribution_channel_id, $appid, $openid, $uid,$send_order_id)
     {
         $appid_info = OfficialAccountService::officialAccountByAppid(['appid' => $appid]);
         if (!$appid_info)
@@ -344,14 +344,14 @@ class ReadOauth
             return false;
         }*/
 
-        $send_order_id = ReadRecordService::getSendOrderId($uid);
+        /*$send_order_id = ReadRecordService::getSendOrderId($uid);
         if ($send_order_id) {
             try {
                 Redis::hset('force_subscribe_from_send_order_id', $appid . '_' . $uid, $send_order_id);
             } catch (\Exception $e) {
             }
 
-        }
+        }*/
         $user_info = ForceSubscribeService::getUserInfoAll($appid, $openid);
         $forcesubuserdata = [
             'appid' => $appid,
@@ -361,6 +361,9 @@ class ReadOauth
             'openid' => $openid,
             'official_account_id' => 1
         ];
+        if($send_order_id){
+            $forcesubuserdata['send_order_id'] = $send_order_id;
+        }
         if ($user_info) {
             isset($user_info['province']) && !empty($user_info['province']) && $forcesubuserdata['province'] = $user_info['province'];
             isset($user_info['nickname']) && !empty($user_info['nickname']) && $forcesubuserdata['nickname'] = $user_info['nickname'];

+ 13 - 4
app/Libs/Helpers.php

@@ -223,14 +223,19 @@ function ImageNewsToArray($datas){
  * 加密site id
  */
 function encodeDistributionChannelId($id){
-    $db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
+    $encrypt_pool = ['14'=>'xyvz5MEXLL52Mzn4','13'=>'laosiji','4372'=>'qhyeyue','365'=>'vciam5tg71'];
+    if(isset($encrypt_pool[$id])){
+        return $encrypt_pool[$id];
+    }
+    /*$db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
         ->where('distribution_channel_id',$id)
         ->where('is_enable',1)
         ->select('en_distribution_channel_id')
         ->first();
+
     if($db_encrypt_info && $db_encrypt_info->en_distribution_channel_id){
         return $db_encrypt_info->en_distribution_channel_id;
-    }
+    }*/
     $hashids = new \Hashids\Hashids('',16,'abcdefghjklmnopqrstuvwxyz1234567890');
     return $hashids->encode($id);
 }
@@ -239,14 +244,18 @@ function encodeDistributionChannelId($id){
  * 解密密site id
  */
 function decodeDistributionChannelId($code){
-    $db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
+    $encrypt_pool = ['xyvz5MEXLL52Mzn4'=>'14','laosiji'=>'13','qhyeyue'=>'4372','vciam5tg71'=>'365'];
+    if(isset($encrypt_pool[$code])){
+        return $encrypt_pool[$code];
+    }
+    /*$db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
         ->where('en_distribution_channel_id',$code)
         ->where('is_enable',1)
         ->select('distribution_channel_id')
         ->first();
     if($db_encrypt_info && $db_encrypt_info->distribution_channel_id){
         return $db_encrypt_info->distribution_channel_id;
-    }
+    }*/
     $hashids = new \Hashids\Hashids('',16,'abcdefghjklmnopqrstuvwxyz1234567890');
     $res = $hashids->decode($code);
     if($res && isset($res[0])){

+ 12 - 5
app/Modules/OfficialAccount/Services/ForceSubscribeService.php

@@ -203,13 +203,20 @@ class ForceSubscribeService
                     if (empty($bid)) {
                         # code...
                         $bid = '0';
+                    }else{
+                        Redis::hdel('force_subscribe_from_bid',$forceSubscribeUsersPrams['appid'].'_'.$forceSubscribeUsersPrams['uid']);
                     }
-
-                    $sendOrderId = Redis::hget('force_subscribe_from_send_order_id',$forceSubscribeUsersPrams['appid'].'_'.$forceSubscribeUsersPrams['uid']);
-                    if (empty($sendOrderId)) {
-                        # code...
-                        $sendOrderId = '0';
+                    if(isset($forceSubscribeUsersPrams['send_order_id']) && !empty($forceSubscribeUsersPrams['send_order_id'])){
+                        $sendOrderId = $forceSubscribeUsersPrams['send_order_id'];
+                    }else{
+                        $sendOrderId = Redis::hget('force_subscribe_from_send_order_id',$forceSubscribeUsersPrams['appid'].'_'.$forceSubscribeUsersPrams['uid']);
+                        if (empty($sendOrderId)) {
+                            $sendOrderId = '0';
+                        }else{
+                            Redis::hdel('force_subscribe_from_send_order_id',$forceSubscribeUsersPrams['appid'].'_'.$forceSubscribeUsersPrams['uid']);
+                        }
                     }
+
                     if($bid && $sendOrderId){
                         $send_order_bid = Redis::hget('sendOrderIdToBid',$sendOrderId);
                         if(!$send_order_bid){