Browse Source

预约订单

wanghaijun 4 years ago
parent
commit
3ea8324630
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Http/Controllers/AppiontController.php

+ 2 - 1
app/Http/Controllers/AppiontController.php

@@ -162,8 +162,9 @@ class AppiontController extends Controller
         $orders = Order::select('id')
         $orders = Order::select('id')
             ->where(['product_type'=>4,'order_status'=>7])
             ->where(['product_type'=>4,'order_status'=>7])
             ->where('appoint_end_time','<',$st)->get();
             ->where('appoint_end_time','<',$st)->get();
+        if(request('c') && !empty($orders)) return count($orders->toArray());
         foreach ($orders as $order){
         foreach ($orders as $order){
-            Order::where('id',$order->id)->update(['order_status'=>4]);
+            Order::where('id',$order->id)->update(['order_status'=>6]);
         }
         }
     }
     }