diff --git a/YD_Event.Application/Event/UnifiedRegistrationService.cs b/YD_Event.Application/Event/UnifiedRegistrationService.cs index ea9653c..5b7271f 100644 --- a/YD_Event.Application/Event/UnifiedRegistrationService.cs +++ b/YD_Event.Application/Event/UnifiedRegistrationService.cs @@ -2966,17 +2966,17 @@ public class UnifiedRegistrationService : ITransient output.ProjectDetails.Add(projectDetail); } - var refundConfigs = await _refundConfigService.GetList(); - refundConfigs = refundConfigs.Where(x => x.Status == Core.Enum.AvailabilityStatus.Enable).OrderBy(x => x.DayStart).ToList(); + // 从快照获取退款规则 + var refundSnapshots = await _ruleSnapshotService.GetRefundRuleSnapshot(eventInfo.Id); - foreach (var config in refundConfigs) + foreach (var snapshot in refundSnapshots) { output.RefundRules.Add(new RefundRuleDto { - DayStart = config.DayStart, - DayEnd = config.DayEnd, - DeductPercentage = config.DeductPercentage, - Remark = config.Remark + DayStart = snapshot.DayStart, + DayEnd = snapshot.DayEnd, + DeductPercentage = snapshot.DeductPercentage, + Remark = snapshot.Remark }); } @@ -2989,7 +2989,7 @@ public class UnifiedRegistrationService : ITransient } else { - var matchConfig = refundConfigs.FirstOrDefault(c => + var matchConfig = refundSnapshots.FirstOrDefault(c => daysRemaining >= c.DayStart && (c.DayEnd == int.MaxValue ? true : daysRemaining < c.DayEnd) );