mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
task claim
This commit is contained in:
@@ -165,7 +165,10 @@ class Exam extends NexusModel
|
||||
$filter = self::FILTER_USER_CLASS;
|
||||
if (!empty($currentFilters[$filter])) {
|
||||
$classes = collect(User::$classes)->only($currentFilters[$filter]);
|
||||
$arr[] = sprintf('%s: %s', nexus_trans("exam.filters.$filter"), $classes->pluck('text')->implode(', '));
|
||||
$arr[] = sprintf(
|
||||
'%s: %s',
|
||||
nexus_trans("exam.filters.$filter"), $classes->map(fn ($value, $key) => User::getClassText($key))->implode(', ')
|
||||
);
|
||||
}
|
||||
|
||||
$filter = self::FILTER_USER_REGISTER_TIME_RANGE;
|
||||
|
||||
@@ -519,6 +519,11 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
return $this->belongsToMany(Exam::class, "exam_users", "uid", "exam_id");
|
||||
}
|
||||
|
||||
public function onGoingExamAndTasks(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->examAndTasks()->wherePivot("status", ExamUser::STATUS_NORMAL);
|
||||
}
|
||||
|
||||
public function getAvatarAttribute($value)
|
||||
{
|
||||
if ($value) {
|
||||
|
||||
Reference in New Issue
Block a user