mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-22 02:47:27 +08:00
refactor exam progress + filter donate status
This commit is contained in:
@@ -59,6 +59,14 @@ class User extends Authenticatable
|
||||
self::CLASS_STAFF_LEADER => ['text' => 'Staff Leader'],
|
||||
];
|
||||
|
||||
const DONATE_YES = 'yes';
|
||||
const DONATE_NO = 'no';
|
||||
|
||||
public static $donateStatus = [
|
||||
self::DONATE_YES => ['text' => 'Yes'],
|
||||
self::DONATE_NO => ['text' => 'No'],
|
||||
];
|
||||
|
||||
public static $cardTitles = [
|
||||
'uploaded_human' => '上传',
|
||||
'downloaded_human' => '下载',
|
||||
@@ -73,6 +81,14 @@ class User extends Authenticatable
|
||||
return self::$classes[$this->class]['text'] ?? '';
|
||||
}
|
||||
|
||||
public function getDonateStatusAttribute()
|
||||
{
|
||||
if (empty($this->donoruntil) || $this->donoruntil == '0000-00-00 00:00:00') {
|
||||
return self::DONATE_NO;
|
||||
}
|
||||
return self::DONATE_YES;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 为数组 / JSON 序列化准备日期。
|
||||
|
||||
Reference in New Issue
Block a user