Ver código fonte

处理首页一年的数据异常问题

Li 2 anos atrás
pai
commit
e22b398d68
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      TEAMModelBI/Controllers/BIHome/OnLineController.cs

+ 5 - 0
TEAMModelBI/Controllers/BIHome/OnLineController.cs

@@ -357,6 +357,11 @@ namespace TEAMModelBI.Controllers.BIHome
                         int tempDay = (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) ? tempDay = 29 : tempDay = 28;
                         timeDay = new DateTime(year, i, tempDay, 0, 0, 0);
                     }
+                    else
+                    {
+                        timeDay = new DateTime(year, i, 1, 0, 0, 0);
+                    }
+
                     var (monthS, monthE) = TimeHelper.GetStartOrEnd(timeDay, "month");   //本月开始/结束时间
 
                     var openLesn = allLess.Where(item => item.startTime >= monthS && item.startTime <= monthE && item.upload == 0).ToList();