improve filament trans + user profile actions

This commit is contained in:
xiaomlove
2022-06-30 21:08:25 +08:00
parent 459d7462de
commit 579351c0eb
27 changed files with 966 additions and 178 deletions

View File

@@ -33,7 +33,7 @@ class ExamUser extends NexusModel
public function getStatusTextAttribute(): string
{
return self::$status[$this->status]['text'] ?? '';
return nexus_trans('exam-user.status.' . $this->status);
}
public function getIsDoneTextAttribute(): string

View File

@@ -9,5 +9,14 @@ class UserMedal extends NexusModel
const STATUS_NOT_WEARING = 0;
const STATUS_WEARING = 1;
public function medal()
{
return $this->belongsTo(Medal::class, 'medal_id');
}
public function user()
{
return $this->belongsTo(User::class, 'uid');
}
}