mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
show rainbow ID in userdetails page
This commit is contained in:
@@ -17,14 +17,18 @@ class UserMeta extends NexusModel
|
||||
|
||||
protected $appends = ['meta_key_text'];
|
||||
|
||||
protected $casts = [
|
||||
'deadline' => 'datetime',
|
||||
];
|
||||
|
||||
public function getMetaKeyTextAttribute()
|
||||
{
|
||||
return nexus_trans('label.user_meta.meta_keys.' . $this->meta_key) ?? '';
|
||||
}
|
||||
|
||||
public static function consumeBenefit($uid, $metaKey)
|
||||
public function isValid(): bool
|
||||
{
|
||||
|
||||
return $this->status == self::STATUS_NORMAL && ($this->getRawOriginal('deadline') === null || ($this->deadline && $this->deadline->gte(now())));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user