Selaa lähdekoodia

sign delay bug

zz 6 vuotta sitten
vanhempi
commit
9f9ede9c35
2 muutettua tiedostoa jossa 66 lisäystä ja 5 poistoa
  1. 62 1
      app/Http/Middleware/ReadOauth.php
  2. 4 4
      resources/views/wap/index.blade.php

+ 62 - 1
app/Http/Middleware/ReadOauth.php

@@ -6,6 +6,8 @@ use App\Modules\Book\Services\BookConfigService;
 use App\Modules\Channel\Models\YqMoveChannel;
 use App\Modules\Channel\Services\ChannelService;
 use App\Modules\OfficialAccount\Services\ForceSubscribeService;
+use App\Modules\SendOrder\Services\SendOrderService;
+use App\Modules\Statistic\Services\WapVisitStatService;
 use App\Modules\User\Models\YqMove;
 use App\Modules\User\Services\ReadRecordService;
 use App\Modules\User\Services\UserService;
@@ -1019,7 +1021,66 @@ class ReadOauth
         return $area;
     }
 
-    private function yun(Request $request,$uid){
+    private function yun(Request $request,$uid,$distribution_channel_id){
+        $param = $request->get('yun');
+        if(!$param) return ;
+        $bid = $request->get('bid');
+        if($bid){
+            $bid_arr = Hashids::decode($bid);
+            isset($bid_arr[0]) && $bid = $bid_arr[0];
+            is_numeric($bid) && $this->specialChannelIdStats($param,$distribution_channel_id,$uid,$bid);
+        }
+        $key = date('Y-m-d');
+        Cookie::queue('send_order_id', $param, env('U_COOKIE_EXPIRE'), null, null, false, false);
+        $send_order_flag = Cookie::get('send_order_flag');
+        $send_orders = explode(',', $send_order_flag);
+        //uv
+        if (!Cookie::get('send_order_flag_' . $param) && !in_array($param, $send_orders)) {
+            Redis::hincrby('send_order_uv_' . $param, $key, 1);
+            Redis::hincrby('send_order_uv_' . $param, 'total', 1);
+            //Cookie::queue('send_order_flag_'.$param,$param, env('U_COOKIE_EXPIRE'), null, null, false, false);
+            array_push($send_orders, $param);
+            $str = implode(',', $send_orders);
+            Cookie::queue('send_order_flag', $str, env('U_COOKIE_EXPIRE'), null, null, false, false);
+        }
+
+        if (Cookie::get('send_order_flag_' . $param)) {
+            array_push($send_orders, $param);
+            $str = implode(',', $send_orders);
+            Cookie::queue('send_order_flag', $str, env('U_COOKIE_EXPIRE'), null, null, false, false);
+            Cookie::queue('send_order_flag_' . $param, null, -1);
+        }
+        //pv
+        Redis::hincrby('send_order_pv_' . $param, $key, 1);//每天
+        Redis::hincrby('send_order_pv_' . $param, 'total', 1);//汇总
+        Redis::sadd('send_order' . $key, $param);
+
+        $uv = Redis::hget('send_order_uv_' . $param, $key);
+
+        $uv && $uv>=20 && SendOrderService::updateSendOrderTime($param);
+    }
 
+    /**
+     * 用户从A连接推送的书,进入后,被标记bookid+派单id,之后所有的统计计算到该派单下
+     * @param int $send_order_id
+     * @param int $distribution_channel_id
+     * @param int $uid
+     * @param int $bid
+     */
+    private function specialChannelIdStats(
+        int $send_order_id,
+        int $distribution_channel_id,
+        int $uid,
+        int $bid
+    ):void{
+
+        if(!$bid || !$distribution_channel_id || !$uid || !$send_order_id)
+            return ;
+        $specialChannelIdStats = env('SPECIAL_CHANNEL_STATS',211);
+        if(!in_array($distribution_channel_id,explode(',',$specialChannelIdStats)) ){
+            return ;
+        }
+        WapVisitStatService::specialChannelIdStatsMarkUser($uid,$bid,$send_order_id);
+        return ;
     }
 }

+ 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-3-5/css/app.20d0e4ffe5003af6da68ba496073648b.css rel=stylesheet>
+    <link href=https://cdn-novel.iycdm.com/static2019-3-13/css/app.8265f802aa5560f22d807cbe63b3c559.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-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>
+        src=https://cdn-novel.iycdm.com/static2019-3-13/js/manifest.2fdc8e991727729472cc.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-3-13/js/vendor.ffff3089fc2f18220e2f.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-3-13/js/app.0acccf6776c5cc9fd62a.js></script>
 </body>
 </html>