From 05cdd4a407049150c60736342eafed5f2026287d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Thu, 25 Jun 2026 20:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=8A=A5=E5=90=8D=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=8F=A3=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YD_Event.Application/Client/EventClientController.cs | 2 +- YD_Event.Application/Event/EventRegistrationService.cs | 5 +++++ YD_Event.Application/Event/EventService.cs | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/YD_Event.Application/Client/EventClientController.cs b/YD_Event.Application/Client/EventClientController.cs index ea54ef3..1ed629a 100644 --- a/YD_Event.Application/Client/EventClientController.cs +++ b/YD_Event.Application/Client/EventClientController.cs @@ -265,7 +265,7 @@ public class EventClientController : IDynamicApiController { var userId = GetCurrentUserId(); isRegistered = await _registrationRepository.IsAnyAsync(r => - r.EventId == id && r.CreatedUserId == userId && + r.EventId == id && r.CreatedUserId == userId && !r.DeleteMark && ((r.PaymentMethod == 2 && r.PaymentStatus == 1) || (r.PaymentMethod == 1 && (r.PaymentStatus == 0 || r.PaymentStatus == 1)))); } catch diff --git a/YD_Event.Application/Event/EventRegistrationService.cs b/YD_Event.Application/Event/EventRegistrationService.cs index 604f61d..9306a2c 100644 --- a/YD_Event.Application/Event/EventRegistrationService.cs +++ b/YD_Event.Application/Event/EventRegistrationService.cs @@ -66,6 +66,8 @@ public class EventRegistrationService : BaseService, ITransie public async Task> Page(RegistrationQueryInput input) { var query = _repository.AsQueryable() + // 排除软删除的报名记录 + .Where(x => !x.DeleteMark) // 线上支付只显示已支付(1),线下支付显示待审核(0)和已支付(1) .Where(x => (x.PaymentMethod == 2 && x.PaymentStatus == 1) || (x.PaymentMethod == 1 && (x.PaymentStatus == 0 || x.PaymentStatus == 1))) .WhereIF(input.EventId.HasValue, x => x.EventId == input.EventId) @@ -501,6 +503,8 @@ public class EventRegistrationService : BaseService, ITransie public async Task Export(RegistrationQueryInput input) { var registrations = await _repository.AsQueryable() + // 排除软删除的报名记录 + .Where(x => !x.DeleteMark) // 线上支付只显示已支付(1),线下支付显示待审核(0)和已支付(1) .Where(x => (x.PaymentMethod == 2 && x.PaymentStatus == 1) || (x.PaymentMethod == 1 && (x.PaymentStatus == 0 || x.PaymentStatus == 1))) .WhereIF(input.EventId.HasValue, x => x.EventId == input.EventId) @@ -689,6 +693,7 @@ public class EventRegistrationService : BaseService, ITransie var athletes = await _personRepository.AsQueryable() .InnerJoin((p, r) => p.RegistrationId == r.Id) .Where((p, r) => r.EventId == eventId + && !r.DeleteMark // 排除软删除的报名记录 // 线上支付只显示已支付(1),线下支付显示待审核(0)和已支付(1) && ((r.PaymentMethod == 2 && r.PaymentStatus == 1) || (r.PaymentMethod == 1 && (r.PaymentStatus == 0 || r.PaymentStatus == 1))) && !p.DeleteMark // 排除已删除的人员 diff --git a/YD_Event.Application/Event/EventService.cs b/YD_Event.Application/Event/EventService.cs index 1b83acc..fadef76 100644 --- a/YD_Event.Application/Event/EventService.cs +++ b/YD_Event.Application/Event/EventService.cs @@ -152,7 +152,9 @@ public class EventService : BaseService, ITransient // 检查是否有报名记录,决定是否可以编辑项目(有报名记录时不能编辑项目和组别) // 排除已取消(PaymentStatus = 4)和软删除的报名记录 - var hasRegistration = await _registrationRepository.IsAnyAsync(x => x.EventId == id && !x.DeleteMark && x.PaymentStatus != 4); + var hasRegistration = await _registrationRepository.IsAnyAsync(r => + r.EventId == id && !r.DeleteMark && + ((r.PaymentMethod == 2 && r.PaymentStatus == 1) || (r.PaymentMethod == 1 && (r.PaymentStatus == 0 || r.PaymentStatus == 1)))); output.CanEditProject = !hasRegistration; // 1. 获取参与单位