Browse Source

Merge branch 'stabble' into style-push

zz 6 years ago
parent
commit
599316de57

+ 2 - 2
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -389,8 +389,8 @@ class ChapterController extends BaseController
 
         $this->is_need_subscribe = !$force_subscribe;
 
-        //图书域名,book_configs表的promotion_domain 要跟当前的主机名匹配 在强关章节后
-        if ($this->is_need_subscribe && $this->isVisitDomainEqualBookDomain($domain)) {
+        //图书域名,book_configs表的promotion_domain 要跟当前的主机名匹配 在强关章节后3章
+        if ($chapter->sequence > $subscribe_seq + 3 && $this->isVisitDomainEqualBookDomain($domain)) {
             if($special_user_log && $special_user_log == $this->uid){
                 $my_log = myLog('special');
                 $my_log->info('book domain not match------------------------');

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

@@ -147,7 +147,7 @@ class OrdersController extends Controller
             return redirect()->to($back_url);
         }
         if (empty($openid)) {
-            $trade_no = date("YmdHis") . hexdec(uniqid());
+            $trade_no = date("YmdHis") . str_shuffle(hexdec(uniqid()));
             $params = compact('uid', 'product_id', 'distribution_channel_id', 'send_order_id', 'bid', 'trade_no', 'pay_redirect_url', 'fromtype', 'activity_id', 'n','suid');
 
             $redirect_url = env('CREATE_PAY_URL') . '?' . http_build_query($params);
@@ -375,7 +375,7 @@ class OrdersController extends Controller
         //根据分校id获取支付配置id
         Log::info($request->all());
 
-        $trade_no =$trade_no = date("YmdHis") . hexdec(uniqid());;
+        $trade_no =$trade_no = date("YmdHis") . str_shuffle(hexdec(uniqid()));
         $order_info = OrderService::getByTradeNo($trade_no);
         if ($order_info) return response()->error('WAP_SYS_ERROR');
 

+ 11 - 8
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)
@@ -339,19 +339,19 @@ class ReadOauth
         $res = ForceSubscribeService::forceSubscribeUsersByUidAndAppid($appid, $uid);
         if ($res) return false;
 
-        /*$forcesubuser = ForceSubscribeService::forceSubscribeUsersByOpenid(['openid' => $openid]);
+        $forcesubuser = ForceSubscribeService::forceSubscribeUsersByOpenid(['openid' => $openid]);
         if ($forcesubuser) {
             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'];

+ 2 - 2
app/Libs/Helpers.php

@@ -474,7 +474,7 @@ function specialChannelAuthInfo(){
         '157'=>'wx5ebe6187c0fb0bd5',
         '4175'=>'wx64cf3051ceb145ae',
         '4217'=>'wxdb15f8db194bf6f4',
-        //'4604'=>'wxc177995c55b5e75e'
+        '4604'=>'wxc177995c55b5e75e'
     ];
 }
 
@@ -488,7 +488,7 @@ function specialChannelAuthInfoV2(){
         '4578'=>'wx3beda81dba0b450b',
         '4580'=>'wxb4bb620409a96ed7',
         '4603'=>'wxf9df2ce5ea94fa4e',
-        '4604'=>'wxb479d38891b14286',
+        //'4604'=>'wxb479d38891b14286',
         '4605'=>'wx72569a8f18599cdb',
         '4606'=>'wxb17c22779a821271',
         '4607'=>'wx2bc3eaf8840f81a8',

+ 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){

+ 4 - 4
resources/views/wap/index.blade.php

@@ -9,7 +9,7 @@
     <script>window.VueRouter || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-router.min.js"><\/script>')</script>
     <script>(window.Vue && window.VueLazyload) || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-lazyload.js"><\/script>')</script>
     <title>{{$title}}</title>
-    <link href=https://cdn-novel.iycdm.com/static2019-2-26/css/app.d297d7c8fc183a981e1f46975246d539.css rel=stylesheet>
+    <link href=https://cdn-novel.iycdm.com/static2019-3-5/css/app.20d0e4ffe5003af6da68ba496073648b.css rel=stylesheet>
 </head>
 <body>
 <div id=app></div>
@@ -32,8 +32,8 @@
     })();</script>
 <script id=options>window.options = {!! $options!!};</script>
 <script type=text/javascript
-        src=https://cdn-novel.iycdm.com/static2019-2-26/js/manifest.7d003de6f804c53bfd53.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-2-26/js/vendor.ffff3089fc2f18220e2f.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-2-26/js/app.8e3905dc735ee0db7950.js></script>
+        src=https://cdn-novel.iycdm.com/static2019-3-5/js/manifest.a66f4944ad2ae01e4dcd.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-3-5/js/vendor.ffff3089fc2f18220e2f.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-3-5/js/app.1c61a2726de943356a04.js></script>
 </body>
 </html>