task claimed count on going

This commit is contained in:
xiaomlove
2024-08-09 21:40:00 +08:00
parent d1fd7f63ff
commit 9b83793c93
3 changed files with 4 additions and 4 deletions

View File

@@ -392,7 +392,7 @@ class ExamRepository extends BaseRepository
throw new NexusException(nexus_trans('exam.claim_by_yourself_only', [], $locale));
}
if ($exam->max_user_count > 0) {
$claimUserCount = ExamUser::query()->where("exam_id", $examId)->count();
$claimUserCount = $exam->onGoingUsers()->count();
if ($claimUserCount >= $exam->max_user_count) {
throw new NexusException(nexus_trans('exam.reach_max_user_count', [], $locale));
}