From 84f4cbb273c11fb955da2e30140e4aeddd313918 Mon Sep 17 00:00:00 2001 From: brusnitsyn Date: Thu, 18 Dec 2025 23:04:04 +0900 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B0=20=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=20?= =?UTF-8?q?=D0=BA=D0=B0=D1=80=D1=82=D1=8B=20=D0=BF=D1=80=D0=B8=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B4=D0=B0=D1=87=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Mis/SttMedicalHistory.php | 7 ++++++- app/Models/SI/SttMedicalHistory.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/Models/Mis/SttMedicalHistory.php b/app/Models/Mis/SttMedicalHistory.php index 39b5085..4208aaf 100644 --- a/app/Models/Mis/SttMedicalHistory.php +++ b/app/Models/Mis/SttMedicalHistory.php @@ -39,7 +39,12 @@ class SttMedicalHistory extends Model ->where('has_lost', false) ->exists(); - return !$hasOpenIssue; + $hasNotBadStatus = $this->archiveInfo() + ->whereNotNull('status_id') + ->whereNot('status_id', 1) + ->exists(); + + return ($hasOpenIssue !== true && $hasNotBadStatus === true); } /** diff --git a/app/Models/SI/SttMedicalHistory.php b/app/Models/SI/SttMedicalHistory.php index 66de56a..224c348 100644 --- a/app/Models/SI/SttMedicalHistory.php +++ b/app/Models/SI/SttMedicalHistory.php @@ -52,7 +52,12 @@ class SttMedicalHistory extends Model ->where('has_lost', false) ->exists(); - return !$hasOpenIssue; + $hasNotBadStatus = $this->archiveInfo() + ->whereNotNull('status_id') + ->whereNot('status_id', 1) + ->exists(); + + return ($hasOpenIssue !== true && $hasNotBadStatus === true); } /**