| xqd
@@ -109,10 +109,16 @@ class AppiontController extends Controller
|
|
|
DB::enableQueryLog();
|
|
|
$order = Order::where('user_id',$user_id)->where('organization_id',$data['area'])->select('id','order_sn','user_id','patient_id','is_ticket')->with('orderPatient:order_id,appoint_start_time,appoint_end_time');
|
|
|
|
|
|
+// if($data['st']){
|
|
|
+// $order = $order->whereHas('orderPatient',function ($query) use ($data){
|
|
|
+// $query->where('appoint_start_time','<=',$data['st']);
|
|
|
+// $query->where('appoint_end_time','>=',$data['st']);
|
|
|
+// });
|
|
|
+// }
|
|
|
+
|
|
|
if($data['st']){
|
|
|
$order = $order->whereHas('orderPatient',function ($query) use ($data){
|
|
|
- $query->where('appoint_start_time','<=',$data['st']);
|
|
|
- $query->where('appoint_end_time','>=',$data['st']);
|
|
|
+ $query->where('appoint_start_time','>=',$data['st']);
|
|
|
});
|
|
|
}
|
|
|
$order_list =$order->first();
|