mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
[exam] schedule
This commit is contained in:
@@ -29,6 +29,17 @@ class ExamUser extends NexusModel
|
||||
return self::$status[$this->status]['text'] ?? '';
|
||||
}
|
||||
|
||||
public function getBeginAttribute()
|
||||
{
|
||||
return $this->begin ?? $this->exam->begin;
|
||||
}
|
||||
|
||||
public function getEndAttribute()
|
||||
{
|
||||
return $this->end ?? $this->exam->end;
|
||||
}
|
||||
|
||||
|
||||
public function exam(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Exam::class, 'exam_id');
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Http\Middleware\Locale;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@@ -117,6 +118,11 @@ class User extends Authenticatable
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getLocaleAttribute()
|
||||
{
|
||||
return Locale::$languageMaps[$this->language->site_lang_folder] ?? 'en';
|
||||
}
|
||||
|
||||
|
||||
public function exams()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user