From 64ad8614a8660d4034f46f64b0a18484681e594c Mon Sep 17 00:00:00 2001 From: Jing Li Date: Sun, 28 Apr 2024 17:47:52 +0800 Subject: [PATCH] Update --- app/Models/WorkflowCheck.php | 16 ++++++++++++++++ app/Traits/HasCheckable.php | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/Models/WorkflowCheck.php b/app/Models/WorkflowCheck.php index 8a03fdd..125553c 100644 --- a/app/Models/WorkflowCheck.php +++ b/app/Models/WorkflowCheck.php @@ -48,4 +48,20 @@ class WorkflowCheck extends Model { return $this->hasMany(WorkflowLog::class, 'check_id'); } + + /** + * 是否审核通过 + */ + public function isCheckSuccess(): bool + { + return $this->check_status === CheckStatus::Success; + } + + /** + * 是否审核未通过 + */ + public function isCheckFailed(): bool + { + return $this->check_status === CheckStatus::Fail; + } } diff --git a/app/Traits/HasCheckable.php b/app/Traits/HasCheckable.php index a50c618..e4ae465 100644 --- a/app/Traits/HasCheckable.php +++ b/app/Traits/HasCheckable.php @@ -75,15 +75,15 @@ trait HasCheckable */ public function isCheckSuccess(): bool { - return $this->workflow->check_status === CheckStatus::Success; + return $this->workflow->isCheckSuccess(); } /** * 是否审核未通过 */ - public function isCheckFail(): bool + public function isCheckFailed(): bool { - return $this->workflow->check_status === CheckStatus::Fail; + return $this->workflow->isCheckFailed(); } public function canUpdate(): bool