From 5a42d6ce4c2bcb182dca126a3f02943ea549e0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Tue, 3 Nov 2026 15:56:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B5=9B=E4=BA=8B=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=84=E5=88=AB=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Event/EventArrangementService.cs | 14 ++++++++------ .../Workbench/WorkbenchController.cs | 6 ++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/YD_Event.Application/Event/EventArrangementService.cs b/YD_Event.Application/Event/EventArrangementService.cs index 7895dc5..3c9d003 100644 --- a/YD_Event.Application/Event/EventArrangementService.cs +++ b/YD_Event.Application/Event/EventArrangementService.cs @@ -16,7 +16,7 @@ namespace YD_Event.Application.Event; { private readonly ISqlSugarRepository _eventProjectRepository; private readonly ISqlSugarRepository _projectRepository; - private readonly ISqlSugarRepository _groupRepository; + private readonly ISqlSugarRepository _eventProjectGroupRepository; private readonly ISqlSugarRepository _personRepository; private readonly ISqlSugarRepository _registrationRepository; private readonly ISqlSugarRepository _eventInfoRepository; @@ -33,7 +33,7 @@ namespace YD_Event.Application.Event; public EventArrangementService( ISqlSugarRepository eventProjectRepository, ISqlSugarRepository projectRepository, - ISqlSugarRepository groupRepository, + ISqlSugarRepository eventProjectGroupRepository, ISqlSugarRepository personRepository, ISqlSugarRepository registrationRepository, ISqlSugarRepository eventInfoRepository, @@ -49,7 +49,7 @@ namespace YD_Event.Application.Event; { _eventProjectRepository = eventProjectRepository; _projectRepository = projectRepository; - _groupRepository = groupRepository; + _eventProjectGroupRepository = eventProjectGroupRepository; _personRepository = personRepository; _registrationRepository = registrationRepository; _eventInfoRepository = eventInfoRepository; @@ -120,7 +120,8 @@ namespace YD_Event.Application.Event; // 按照 SortIndex 对 projects 排序 var sortedProjects = projects.OrderBy(x => x.SortIndex).ThenBy(x => x.Id).ToList(); - var groups = await _groupRepository.GetListAsync(x => projectIds.Contains(x.ProjectId)); + var groups = await _eventProjectGroupRepository.GetListAsync(x => + x.EventId == eventId && projectIds.Contains(x.ProjectId) && !x.DeleteMark); // 统计各组别报名人数(统计所有非取消状态的报名,并且只统计运动员 var counts = await _personRepository.AsQueryable() @@ -322,7 +323,8 @@ namespace YD_Event.Application.Event; // 按照 SortIndex 对 projects 排序 var sortedProjects = projects.OrderBy(x => x.SortIndex).ThenBy(x => x.Id).ToList(); - var groups = await _groupRepository.GetListAsync(x => projectIds.Contains(x.ProjectId)); + var groups = await _eventProjectGroupRepository.GetListAsync(x => + x.EventId == eventId && projectIds.Contains(x.ProjectId) && !x.DeleteMark); // 统计各组别报名人数 var counts = await _personRepository.AsQueryable() @@ -637,7 +639,7 @@ namespace YD_Event.Application.Event; /// private static void AssignFreestyleVenues( List entries, - IReadOnlyCollection projectGroups, + IReadOnlyCollection projectGroups, int venueCount, int firstSessionIndex) { diff --git a/YD_Event.Application/Workbench/WorkbenchController.cs b/YD_Event.Application/Workbench/WorkbenchController.cs index 93a98f0..b25dbd9 100644 --- a/YD_Event.Application/Workbench/WorkbenchController.cs +++ b/YD_Event.Application/Workbench/WorkbenchController.cs @@ -109,10 +109,8 @@ public partial class WorkbenchController : IDynamicApiController .Where(e => !e.DeleteMark) .WhereIF(!string.IsNullOrWhiteSpace(input.EventName), e => e.EventName.Contains(input.EventName!.Trim())); - // 报名平台入口只展示进行中/已结束的赛事;秩序册入口不限制赛事状态 - if (mode == "registration") - query = query.Where(e => e.EventStatus == Core.Enum.EventStatus.Ongoing || e.EventStatus == Core.Enum.EventStatus.Ended); - else if (mode != "orderbook") + // 两种数据来源均展示全部未删除赛事,仅校验来源参数是否合法 + if (mode != "registration" && mode != "orderbook") throw Oops.Bah("数据来源只能为registration或orderbook"); return await query.OrderByDescending(e => e.MatchStartTime)