瀏覽代碼

Merge branch 'stabble' into yunqi

zz 6 年之前
父節點
當前提交
6d54fe924d

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

@@ -347,6 +347,10 @@ class ChapterController extends BaseController
         //用户是否强关
         $this->is_had_subscribe = $is_had_subscribe = $inter_not_need_sub ? true : $this->getSubscribe();
 
+        //阅读记录
+        ReadRecordService::addReadRecord(['uid' => $this->uid, 'bid' => $bid, 'book_name' => $book_info->book_name,
+            'cid' => $cid, 'chapter_name' => $chapter->name]);
+
         //判断当前是否有强制显示服务号信息的cookie、已经关注 跳转到服务号信息引导页
         if(Cookie::get('force_show_qrcode') && $is_had_subscribe)
         {
@@ -366,9 +370,6 @@ class ChapterController extends BaseController
             //vip前一张和枪管前一张的访问统计
             $this->beforeForceSubAndBeforeVipUvAndPv($book_info, $subscribe_seq, $chapter);
         }
-        //阅读记录
-        ReadRecordService::addReadRecord(['uid' => $this->uid, 'bid' => $bid, 'book_name' => $book_info->book_name,
-            'cid' => $cid, 'chapter_name' => $chapter->name]);
 
         //不用关注且不是vip章节
         if ($force_subscribe && $chapter->is_vip == 0) {

+ 7 - 6
app/Http/Controllers/Wap/Web/RedirectController.php

@@ -47,7 +47,13 @@ class RedirectController extends Controller
         $link = SendOrderService::getRedirectUrlById($param);
         $query_param = $request->except('_url');
         $query_param['soid'] = $param;
-        $query_param['source'] = 'wechatmsg';
+        //判断是否强制到服务号阅读
+        if($link->force_show_qrcode)
+        {
+            Cookie::queue('force_show_qrcode', 1, 1);
+        }else{
+            $query_param['source'] = 'wechatmsg';
+        }
         $query_param['stats'] = 3;
         $query = '';
         if ($query_param) {
@@ -110,11 +116,6 @@ class RedirectController extends Controller
                 $this->updateSendOrderTime($param, $uv);
             }
 
-            //判断是否强制到服务号阅读
-            if($link->force_show_qrcode)
-            {
-                Cookie::queue('force_show_qrcode', 1, 1);
-            }
             //
             $redirect_path = $request->get('redirect_path');
            if($redirect_path){

+ 3 - 3
app/Modules/User/Services/ReadRecordService.php

@@ -123,7 +123,7 @@ class ReadRecordService
         //Redis::hset('book_read:'.$uid, $bid, $cid."_".time());
         Redis::hset('book_read:' . $uid, $bid, "{$cid}_" . time());
     }
-
+    
     /**
      * 删除
      * @param $uid
@@ -330,8 +330,8 @@ class ReadRecordService
             return $res;
         }
         foreach ($read_bids as $key => $v) {
-            if(in_array($key,self::$not_uid_key)){
-            	continue;
+            if(in_array($key,self::$not_uid_key)){
+            	continue;
             }
             array_push($res,$key);
         }