exam user show is_done

This commit is contained in:
xiaomlove
2021-05-15 02:13:33 +08:00
parent a0bb422a58
commit dea20254bf
25 changed files with 32 additions and 20 deletions

View File

@@ -19,6 +19,11 @@ class ExamUser extends NexusModel
const IS_DONE_YES = 1;
const IS_DONE_NO = 0;
public static $isDoneInfo = [
self::IS_DONE_YES => ['text' => 'Yes'],
self::IS_DONE_NO => ['text' => 'No'],
];
protected $casts = [
'progress' => 'json'
@@ -29,6 +34,11 @@ class ExamUser extends NexusModel
return self::$status[$this->status]['text'] ?? '';
}
public function getIsDoneTextAttribute(): string
{
return self::$isDoneInfo[$this->is_done]['text'] ?? '';
}
public function getBeginAttribute()
{
$begin = $this->getRawOriginal('begin');