|
@@ -159,9 +159,10 @@ class AppiontController extends Controller
|
|
public function orverTime()
|
|
public function orverTime()
|
|
{
|
|
{
|
|
$st = strtotime('2020-02-25 18:00:00');
|
|
$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());
|
|
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'=>6]);
|
|
Order::where('id',$order->id)->update(['order_status'=>6]);
|