Проверка на статус карты при выдаче

This commit is contained in:
brusnitsyn
2025-12-18 23:04:04 +09:00
parent 6b670c4d29
commit 84f4cbb273
2 changed files with 12 additions and 2 deletions

View File

@@ -39,7 +39,12 @@ class SttMedicalHistory extends Model
->where('has_lost', false) ->where('has_lost', false)
->exists(); ->exists();
return !$hasOpenIssue; $hasNotBadStatus = $this->archiveInfo()
->whereNotNull('status_id')
->whereNot('status_id', 1)
->exists();
return ($hasOpenIssue !== true && $hasNotBadStatus === true);
} }
/** /**

View File

@@ -52,7 +52,12 @@ class SttMedicalHistory extends Model
->where('has_lost', false) ->where('has_lost', false)
->exists(); ->exists();
return !$hasOpenIssue; $hasNotBadStatus = $this->archiveInfo()
->whereNotNull('status_id')
->whereNot('status_id', 1)
->exists();
return ($hasOpenIssue !== true && $hasNotBadStatus === true);
} }
/** /**