|
@@ -302,12 +302,12 @@ class AppointmentService
|
|
|
|
|
|
public static function update(Request $request)
|
|
|
{
|
|
|
- $appointmentId = $request->post('appointment_id');
|
|
|
+ $params = $request->post();
|
|
|
+ $appointmentId = $params['appointment_id'];
|
|
|
$appointment = Appointment::where('appointment_id', $appointmentId)->first();
|
|
|
- if (!$appointment) {
|
|
|
+ if (empty($appointment)) {
|
|
|
return json_fail("数据不存在");
|
|
|
}
|
|
|
- $params = $request->post();
|
|
|
Db::beginTransaction();
|
|
|
try {
|
|
|
// 先检查选择的时段是否可预约
|