管理员删除计划

main
yanzai 2 years ago
parent 90d955278b
commit 511679a0f7

@ -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]);
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]);
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]);
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);
}

Loading…
Cancel
Save