From ca440d860881013eb4cb7fb507a4c06a61a8fe12 Mon Sep 17 00:00:00 2001 From: xjl <2595686544@qq.com> Date: Sun, 23 Jun 2024 19:23:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=96=E5=B3=B0=E5=B9=B3=E8=B0=B7=E7=94=B5?= =?UTF-8?q?=E4=BB=B7=E7=9A=84=E6=97=B6=E9=97=B4=E5=8C=BA=E9=97=B4=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/BasicConfig/BaseConfigController.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/WebStarter/Controllers/BasicConfig/BaseConfigController.cs b/WebStarter/Controllers/BasicConfig/BaseConfigController.cs index 8ade8b0..d6c183a 100644 --- a/WebStarter/Controllers/BasicConfig/BaseConfigController.cs +++ b/WebStarter/Controllers/BasicConfig/BaseConfigController.cs @@ -306,12 +306,15 @@ namespace WebStarter.Controllers.BasicConfig for (int i = 0; i < timePeriods.Count; i++) { - for (int j = i + 1; j < timePeriods.Count; j++) + if (timePeriods[i].StartHour != 0 && timePeriods[i].StartMinute != 0 && timePeriods[i].StartSecond != 0 && timePeriods[i].EndHour != 0 && timePeriods[i].EndMinute != 0 && timePeriods[i].EndSecond != 0)//排除开始和结束时间都是0点的不判断 { - if (timePeriods[i].Contains(timePeriods[j]) || timePeriods[j].Contains(timePeriods[i])) + for (int j = i + 1; j < timePeriods.Count; j++) { - notHasOverlap = false; - return notHasOverlap; + if (timePeriods[i].Contains(timePeriods[j]) || timePeriods[j].Contains(timePeriods[i])) + { + notHasOverlap = false; + return notHasOverlap; + } } } }