修复 工单 先判断管理员

This commit is contained in:
iVampireSP.com 2023-01-01 21:44:47 +08:00
parent 3a19269ab6
commit a66b8a0298
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -91,7 +91,9 @@ protected static function boot()
// change work order status
if (auth('sanctum')->check()) {
if (auth('admin')->check()) {
$model->role = 'admin';
} else if (auth('sanctum')->check()) {
$model->user_id = auth('sanctum')->id();
$model->role = 'user';
$model->workOrder->status = 'user_replied';
@ -103,8 +105,6 @@ protected static function boot()
broadcast(new UserEvent($model->user_id, 'work-order.replied', $model->workOrder));
} else if (auth('admin')->check()) {
$model->role = 'admin';
} else {
$model->role = 'guest';
}