改进 工单状态变更

This commit is contained in:
iVampireSP.com 2023-02-22 17:08:54 +08:00
parent 69283b0f93
commit 1ef43d601f
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -142,9 +142,13 @@ public function markAsRead(): bool
return false; return false;
} }
if (auth('admin')->check()) { if (auth('admin')->check() && $this->status !== 'replied') {
$this->status = 'read'; $this->status = 'read';
} else { } elseif (
(auth('api')->check() || auth('sanctum')->check())
&&
$this->status !== 'user_replied'
) {
$this->status = 'user_read'; $this->status = 'user_read';
} }