Browse Source

new auth send order bugs

zz 6 years ago
parent
commit
0ca65da182

+ 11 - 0
app/Http/Controllers/Wap/Oauth/UsersV2Controller.php

@@ -11,6 +11,7 @@ use Log;
 use EasyWeChat\Foundation\Application;
 use DB;
 use Hashids;
+use Redis;
 
 class UsersV2Controller extends Controller
 {
@@ -87,6 +88,11 @@ class UsersV2Controller extends Controller
         $url = sprintf('%s://%s%s?%s',$url_info['scheme'],$url_info['host'],$url_info['path'],http_build_query($query));
         Log::info('wcCallbackParse back url is :');
         Log::info($url);
+        if($send_order_id){
+            try{
+                Redis::hset('book_read:' . $user->id, 'send_order_id', $send_order_id);
+            }catch (\Exception $e){}
+        }
         //$previous = url()->previous();
         return redirect()->to($url)->withHeaders(['referer'=>url()->current()]);
     }
@@ -159,6 +165,11 @@ class UsersV2Controller extends Controller
         $url = sprintf('%s://%s%s?%s',$url_info['scheme'],$url_info['host'],$url_info['path'],http_build_query($query));
         Log::info('wcCallbackParse back url is :');
         Log::info($url);
+        if($send_order_id){
+            try{
+                Redis::hset('book_read:' . $user->id, 'send_order_id', $send_order_id);
+            }catch (\Exception $e){}
+        }
         //$previous = url()->previous();
         return redirect()->to($url);
     }

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

@@ -1041,7 +1041,11 @@ class ReadOauth
         if (!$send_order_info) return;
         if ($send_order_info->book_id && $send_order_info->book_id != $bid) return;
         if ($send_order_info->distribution_channel_id != $distribution_channel_id) return;
-
+        if($uid){
+            try{
+                Redis::hset('book_read:' . $uid, 'send_order_id', $param);
+            }catch (\Exception $e){}
+        }
         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);