修复 工单 先判断管理员
This commit is contained in:
parent
3a19269ab6
commit
a66b8a0298
@ -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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user