mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
exam-index
This commit is contained in:
+28
-1
@@ -3,11 +3,38 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Exam extends NexusModel
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['name', 'description', 'begin', 'end', 'status'];
|
||||
|
||||
const STATUS_ENABLED = 0;
|
||||
const STATUS_DISABLED = 1;
|
||||
|
||||
public static $status = [
|
||||
self::STATUS_ENABLED => ['text' => '启用中'],
|
||||
self::STATUS_DISABLED => ['text' => '已禁用'],
|
||||
];
|
||||
|
||||
const INDEX_UPLOADED = 1;
|
||||
const INDEX_SEED_TIME = 2;
|
||||
const INDEX_DOWNLOADED = 3;
|
||||
const INDEX_LEECH_TIME = 4;
|
||||
const INDEX_BONUS = 5;
|
||||
|
||||
public static $indexes = [
|
||||
self::INDEX_UPLOADED => ['text' => 'Uploaded'],
|
||||
self::INDEX_SEED_TIME => ['text' => 'Seed time'],
|
||||
self::INDEX_DOWNLOADED => ['text' => 'Download'],
|
||||
self::INDEX_LEECH_TIME => ['text' => 'Leech time'],
|
||||
self::INDEX_BONUS => ['text' => 'Bonus'],
|
||||
];
|
||||
|
||||
public function getStatusTextAttribute()
|
||||
{
|
||||
return self::$status[$this->status]['text'] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ class User extends Authenticatable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['username', 'email', 'password', 'secret', 'editsecret', 'added'];
|
||||
protected $fillable = ['username', 'email', 'passhash', 'secret', 'editsecret', 'added'];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
@@ -96,6 +96,6 @@ class User extends Authenticatable
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user