mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
[exam] add progress do update the same time
This commit is contained in:
+3
-3
@@ -22,13 +22,13 @@ class Exam extends NexusModel
|
||||
];
|
||||
|
||||
const INDEX_UPLOADED = 1;
|
||||
const INDEX_SEED_TIME_AVERGAGE = 2;
|
||||
const INDEX_SEED_TIME_AVERAGE = 2;
|
||||
const INDEX_DOWNLOADED = 3;
|
||||
const INDEX_BONUS = 4;
|
||||
|
||||
public static $indexes = [
|
||||
self::INDEX_UPLOADED => ['name' => 'Uploaded', 'unit' => 'GB'],
|
||||
self::INDEX_SEED_TIME_AVERGAGE => ['name' => 'Seed Time Average', 'unit' => 'Hour'],
|
||||
self::INDEX_SEED_TIME_AVERAGE => ['name' => 'Seed Time Average', 'unit' => 'Hour'],
|
||||
self::INDEX_DOWNLOADED => ['name' => 'Downloaded', 'unit' => 'GB'],
|
||||
self::INDEX_BONUS => ['name' => 'Bonus', 'unit' => ''],
|
||||
];
|
||||
@@ -41,7 +41,7 @@ class Exam extends NexusModel
|
||||
self::FILTER_USER_REGISTER_TIME_RANGE => ['name' => 'User Register Time Range'],
|
||||
];
|
||||
|
||||
public function getStatusTextAttribute()
|
||||
public function getStatusTextAttribute(): string
|
||||
{
|
||||
return self::$status[$this->status]['text'] ?? '';
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Models;
|
||||
|
||||
class ExamUser extends NexusModel
|
||||
{
|
||||
protected $fillable = ['exam_id', 'uid', 'status', 'result'];
|
||||
protected $fillable = ['exam_id', 'uid', 'status', 'progress'];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -17,7 +17,7 @@ class ExamUser extends NexusModel
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'result' => 'json'
|
||||
'progress' => 'json'
|
||||
];
|
||||
|
||||
public function getStatusTextAttribute()
|
||||
|
||||
@@ -11,7 +11,7 @@ class NexusModel extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $perPage = 2;
|
||||
// protected $perPage = 2;
|
||||
|
||||
/**
|
||||
* 为数组 / JSON 序列化准备日期。
|
||||
|
||||
@@ -57,8 +57,6 @@ class User extends Authenticatable
|
||||
self::CLASS_STAFF_LEADER => ['text' => 'Staff Leader'],
|
||||
];
|
||||
|
||||
protected $perPage = 2;
|
||||
|
||||
public function getClassTextAttribute(): string
|
||||
{
|
||||
return self::$classes[$this->class]['text'] ?? '';
|
||||
|
||||
Reference in New Issue
Block a user