| xqd
@@ -182,8 +182,8 @@ class Order extends BaseModel
|
|
|
}
|
|
|
Order::where('id', $order_id)->update($updateOrder);
|
|
|
|
|
|
- //如果距离预约时间还有半个小时以上,那么预约时间段的订单数减1
|
|
|
- if ($order['order_patient']['appoint_start_time'] - 1800 > time()) {
|
|
|
+ //如果是预约类订单且距离预约时间还有半个小时以上,那么预约时间段的订单数减1
|
|
|
+ if (in_array($order['product_type'], [3,4,5]) && $order['order_patient']['appoint_start_time'] - 1800 > time()) {
|
|
|
$schedule_date = date('Y-m-d', $order['order_patient']['appoint_start_time']);
|
|
|
SchedulePeriod::where('docter_id', $order['docter_id'])->where('organization_id', $order['organization_id'])->where('time_period_id', $order['order_patient']['time_period_id'])->where('schedule_date', $schedule_date)->decrement('order_num');
|
|
|
}
|