|
@@ -94,12 +94,13 @@ class User extends Permissions
|
|
|
$appoint = $ticket->appointment;
|
|
|
//判断该时间段,存在于时间列表中才行
|
|
|
if ($post['appointment_period'] == 1) {
|
|
|
- $timePeriods = DateHelper::splitTimePeriod($appoint->morning_start_time, $appoint->morning_end_time, $appoint->morning_num);
|
|
|
+ $timePeriods = $appoint->morning_time_periods;
|
|
|
} elseif ($post['appointment_period'] == 2) {
|
|
|
- $timePeriods = DateHelper::splitTimePeriod($appoint->afternoon_start_time, $appoint->afternoon_end_time, $appoint->afternoon_num);
|
|
|
+ $timePeriods = $appoint->afternoon_time_periods;
|
|
|
} else {
|
|
|
- $timePeriods = DateHelper::splitTimePeriod($appoint->night_start_time, $appoint->night_end_time, $appoint->night_num);
|
|
|
+ $timePeriods = [];//晚上没有
|
|
|
}
|
|
|
+
|
|
|
if (!in_array($post['appointment_time'], $timePeriods)) {
|
|
|
$this->json_error("该时间段不存在,请重新选择时间");
|
|
|
}
|