Ver código fonte

预约订单

wanghaijun 4 anos atrás
pai
commit
d5c3cf0ef0
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      app/Http/Controllers/AppiontController.php

+ 4 - 3
app/Http/Controllers/AppiontController.php

xqd
@@ -159,9 +159,10 @@ class AppiontController extends Controller
     public function orverTime()
     {
         $st = strtotime('2020-02-25 18:00:00');
-        $orders = Order::select('id')
-            ->where(['product_type'=>4,'order_status'=>7])
-            ->where('appoint_end_time','<',$st)->get();
+//        $orders = Order::select('id')
+//            ->where(['product_type'=>4,'order_status'=>7])
+//            ->where('appoint_end_time','<',$st)->get();
+        $orders = Order::leftjoin('order_patients','order_patients.order_id','=','orders.id')->where('order_patients.appoint_end_time','<',$st)->get(['orders.id']);
         if(request('c') && !empty($orders)) return count($orders->toArray());
         foreach ($orders as $order){
             Order::where('id',$order->id)->update(['order_status'=>6]);