From bd1ab5fc9a56de75e4e110ac6883964d0b49680d Mon Sep 17 00:00:00 2001 From: xiaomlove <353856593@qq.com> Date: Sat, 8 May 2021 16:31:19 +0800 Subject: [PATCH] fix duration_text attribute --- app/Models/Exam.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/Exam.php b/app/Models/Exam.php index 9cf478f2..166f701b 100644 --- a/app/Models/Exam.php +++ b/app/Models/Exam.php @@ -68,10 +68,10 @@ class Exam extends NexusModel return self::$discovers[$this->is_discovered]['text'] ?? ''; } - public function getDurationTextAttribute($value): string + public function getDurationTextAttribute(): string { - if ($value > 0) { - return $value . ' Days'; + if ($this->duration > 0) { + return $this->duration . ' Days'; } return ''; }