From 511679a0f7aae53efff89686fc3c3a59b8f42c42 Mon Sep 17 00:00:00 2001 From: yanzai Date: Sat, 11 May 2024 18:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AppointmentController.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AppointmentController.php b/app/Http/Controllers/AppointmentController.php index dc47897..9530a4e 100644 --- a/app/Http/Controllers/AppointmentController.php +++ b/app/Http/Controllers/AppointmentController.php @@ -202,7 +202,12 @@ 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]); + //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 +216,12 @@ 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]); + // 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 +230,12 @@ 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]); + // 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); }