fix duration_text attribute

This commit is contained in:
xiaomlove
2021-05-08 16:31:19 +08:00
parent d23a85a888
commit bd1ab5fc9a

View File

@@ -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 '';
}