From 7ff4a6922e936a0cd5d92daa61ad7e62c8502069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8D=E6=BD=9C?= <1620556043@qq.com> Date: Mon, 24 Mar 2025 17:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AD=A6=E7=94=9F=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=8F=AF=E5=8F=82=E5=8A=A0=E7=9A=84=E8=80=83=E8=AF=95?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/CodeSpirit.ExamApi/Services/ClientService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/CodeSpirit.ExamApi/Services/ClientService.cs b/Src/CodeSpirit.ExamApi/Services/ClientService.cs index 486003d..e251664 100644 --- a/Src/CodeSpirit.ExamApi/Services/ClientService.cs +++ b/Src/CodeSpirit.ExamApi/Services/ClientService.cs @@ -47,9 +47,10 @@ public class ClientService : IClientService // 获取可参加的考试 var now = DateTime.Now; var availableExams = await _context.ExamSettings + .Include(e => e.StudentGroups) .Include(e => e.ExamPaper) .Where(e => e.StartTime <= now && e.EndTime >= now) - .Where(e => e.StudentGroups.Any(g => studentGroups.Contains(g.Id)) || !e.StudentGroups.Any()) + .Where(e => e.StudentGroups.Any() == false || e.StudentGroups.Any(g => studentGroups.Contains(g.StudentGroupId))) .Select(e => new ClientExamDto { Id = e.Id, -- Gitee