From 7440b95e9a7870ed6a904bbcf79594fccbd1b411 Mon Sep 17 00:00:00 2001 From: biss Date: Sat, 14 Nov 2026 14:11:50 +0800 Subject: [PATCH] fix --- .../Infrastructure/Scheduling/AutomaticScheduleGenerator.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Jiaowu.Api/Infrastructure/Scheduling/AutomaticScheduleGenerator.cs b/src/Jiaowu.Api/Infrastructure/Scheduling/AutomaticScheduleGenerator.cs index 632fbaf..b5db91e 100644 --- a/src/Jiaowu.Api/Infrastructure/Scheduling/AutomaticScheduleGenerator.cs +++ b/src/Jiaowu.Api/Infrastructure/Scheduling/AutomaticScheduleGenerator.cs @@ -680,6 +680,8 @@ public sealed class AutomaticScheduleGenerator(AppDbContext db) { var start = Math.Max(first.StartWeek, second.StartWeek); var end = Math.Min(first.EndWeek, second.EndWeek); + if (start > end) return false; + return Enumerable.Range(start, end - start + 1).Any(week => IncludesWeek(first.WeekPattern, week) && IncludesWeek(second.WeekPattern, week)); }