root 5 years ago
parent
commit
09e31dc70b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/Http/Controllers/OrderController.php

+ 5 - 1
app/Http/Controllers/OrderController.php

@@ -55,9 +55,13 @@ class OrderController extends Controller
     }
 
     private function isExistNotPayOrderByUserId ($userId) {
-        return Order::where('status', 1)
+        $order = Order::where('status', 1)
             ->where('user_id', $userId)
             ->first();
+        if (!$order) {
+            return false;
+        }
+        return true;
     }
     
     public function save (OrderSave $request) {