fix exam can not assign again

This commit is contained in:
xiaomlove
2024-07-23 02:22:07 +08:00
parent 64490f808f
commit 3a744eba92
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -385,7 +385,7 @@ class ExamRepository extends BaseRepository
if ($user->exams()->where('status', ExamUser::STATUS_NORMAL)->exists()) { if ($user->exams()->where('status', ExamUser::STATUS_NORMAL)->exists()) {
throw new NexusException(nexus_trans('exam.has_other_on_the_way', ['type_text' => $exam->typeText], $locale)); throw new NexusException(nexus_trans('exam.has_other_on_the_way', ['type_text' => $exam->typeText], $locale));
} }
$exists = $user->exams()->where('exam_id', $exam->id)->exists(); $exists = ExamUser::query()->where('exam_id', $exam->id)->where("status", ExamUser::STATUS_NORMAL)->exists();
if ($exists) { if ($exists) {
throw new NexusException(nexus_trans('exam.claimed_already', [], $locale)); throw new NexusException(nexus_trans('exam.claimed_already', [], $locale));
} }
+2 -2
View File
@@ -1,6 +1,6 @@
<?php <?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.12'); defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.13');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-07-13'); defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-07-23');
defined('IN_TRACKER') || define('IN_TRACKER', false); defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");