管理员可修改删除号源

main
yanzai 1 year ago
parent 45d169a4bd
commit 39887a67d1

@ -202,7 +202,11 @@ class AppointmentController extends Controller
if (count($appointments_to_delete)) { if (count($appointments_to_delete)) {
return Yo::error_echo(200023); 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); return Yo::delete_echo($ids);
} }
@ -211,7 +215,11 @@ class AppointmentController extends Controller
Login::admin([], [15, 27]); Login::admin([], [15, 27]);
$ids = $request->post('ids'); $ids = $request->post('ids');
$status = $request->post('status'); $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); return Yo::update_echo($ids);
} }
@ -220,7 +228,11 @@ class AppointmentController extends Controller
Login::admin([], [15, 27]); Login::admin([], [15, 27]);
$ids = $request->post('ids'); $ids = $request->post('ids');
$count = $request->post('count'); $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); return Yo::update_echo($ids);
} }

Loading…
Cancel
Save