From 39887a67d166a64b98e842701fdcc5feaab96f62 Mon Sep 17 00:00:00 2001 From: yanzai Date: Thu, 8 Aug 2024 14:03:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=8F=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=A0=E9=99=A4=E5=8F=B7=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/AppointmentController.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AppointmentController.php b/app/Http/Controllers/AppointmentController.php index 3586695..001cfd5 100644 --- a/app/Http/Controllers/AppointmentController.php +++ b/app/Http/Controllers/AppointmentController.php @@ -202,7 +202,11 @@ class AppointmentController extends Controller if (count($appointments_to_delete)) { return Yo::error_echo(200023); } - Appointment::whereIn('id', $ids)->where('hospital', Login::$info->hospital)->update(['del' => 1]); + if(Login::$info->id==1){ + Appointment::whereIn('id', $ids)->update(['del' => 1]); + }else{ + Appointment::whereIn('id', $ids)->where('hospital', Login::$info->hospital)->update(['del' => 1]); + } return Yo::delete_echo($ids); } @@ -211,7 +215,11 @@ class AppointmentController extends Controller Login::admin([], [15, 27]); $ids = $request->post('ids'); $status = $request->post('status'); - Appointment::whereIn('id', $ids)->where('hospital', Login::$info->hospital)->update(['status' => $status]); + if(Login::$info->id==1){ + Appointment::whereIn('id', $ids)->update(['status' => $status]); + }else{ + Appointment::whereIn('id', $ids)->where('hospital', Login::$info->hospital)->update(['status' => $status]); + } return Yo::update_echo($ids); } @@ -220,7 +228,11 @@ class AppointmentController extends Controller Login::admin([], [15, 27]); $ids = $request->post('ids'); $count = $request->post('count'); - Appointment::whereIn('id', $ids)->where('hospital', Login::$info->hospital)->update(['max_count' => $count]); + if(Login::$info->id==1){ + Appointment::whereIn('id', $ids)->update(['max_count' => $count]); + }else{ + Appointment::whereIn('id', $ids)->where('hospital', Login::$info->hospital)->update(['max_count' => $count]); + } return Yo::update_echo($ids); }