mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
medal valid forever text
This commit is contained in:
@@ -39,6 +39,14 @@ class Medal extends NexusModel
|
||||
return nexus_trans("medal.get_types." . $this->get_type);
|
||||
}
|
||||
|
||||
public function getDurationTextAttribute($value): string
|
||||
{
|
||||
if ($this->duration > 0) {
|
||||
return $this->duration;
|
||||
}
|
||||
return nexus_trans("label.permanent");
|
||||
}
|
||||
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'user_medals', 'medal_id', 'uid')->withTimestamps();
|
||||
|
||||
Reference in New Issue
Block a user