| xqd
@@ -158,11 +158,13 @@ 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::leftjoin('order_patients','order_patients.order_id','=','orders.id')->where('order_patients.appoint_end_time','<',$st)->get(['orders.id']);
|
|
|
+ $st = strtotime('2021-02-25 18:00:00');
|
|
|
+ $orders = Order::select('id')
|
|
|
+ ->where(['product_type'=>4,'order_status'=>7])
|
|
|
+ ->where('appoint_end_time','<',$st)->get();
|
|
|
+// DB::enableQueryLog();
|
|
|
+// $orders = Order::leftjoin('order_patients','order_patients.order_id','=','orders.id')->where(['orders.product_type'=>4,'orders.order_status'=>7])->where('order_patients.appoint_end_time','<',$st)->get(['orders.id']);
|
|
|
+// dd(DB::getQueryLog());
|
|
|
if(request('c') && !empty($orders)) return count($orders->toArray());
|
|
|
foreach ($orders as $order){
|
|
|
Order::where('id',$order->id)->update(['order_status'=>6]);
|