zz 6 年之前
父節點
當前提交
b8d7708ee8
共有 1 個文件被更改,包括 19 次插入10 次删除
  1. 19 10
      app/Http/Controllers/Wap/Pay/OrdersController.php

+ 19 - 10
app/Http/Controllers/Wap/Pay/OrdersController.php

@@ -606,6 +606,14 @@ class OrdersController extends Controller
         if (substr_count($url, '?') > 1) {
             $url = str_replace_last('?', '&', $url);
         }
+        $order_info = OrderService::getByTradeNo($order);
+        $uid = $order_info->uid;
+        $bind_info = UserBindPhoneService::bindInfo($uid);
+        $page = 'pay.order.wait';
+        if(!$bind_info){
+            $page = 'pay.order.bindPhone';
+        }
+
         $url_info = parse_url($url);
         if (isset($url_info['query']) && !empty($url_info['query'])) {
             parse_str($url_info['query'], $path);
@@ -615,20 +623,21 @@ class OrdersController extends Controller
                     $path['cid'] = $chapter_info->prev_cid;
                     $url = sprintf('%s://%s/reader?%s', $url_info['scheme'], $url_info['host'], http_build_query($path));
                 }
-                return redirect($url);
+                if(!$bind_info){
+                    return view('pay.order.bindPhone', compact('order', 'url'));
+                }else{
+                    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);
-        }
-
-        $order_info = OrderService::getByTradeNo($order);
-        $uid = $order_info->uid;
-        $bind_info = UserBindPhoneService::bindInfo($uid);
-        $page = 'pay.order.wait';
-        if(!$bind_info){
-            $page = 'pay.order.bindPhone';
+            //return redirect($url);
+            if(!$bind_info){
+                return view('pay.order.bindPhone', compact('order', 'url'));
+            }else{
+                return redirect($url);
+            }
         }
         return view($page, compact('order', 'url'));
     }