Explorar o código

调整入学年计算方式

zhouj1203@hotmail.com %!s(int64=3) %!d(string=hai) anos
pai
achega
df4fa0fce0
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      TEAMModelOS/Controllers/Analysis/AnalysisController.cs

+ 9 - 1
TEAMModelOS/Controllers/Analysis/AnalysisController.cs

@@ -1642,7 +1642,15 @@ namespace TEAMModelOS.Controllers.Analysis
                             int year = DateTimeOffset.UtcNow.Year;
                             int month = DateTimeOffset.UtcNow.Month;
                             int day = DateTimeOffset.UtcNow.Day;
-                            int time = month > semester.month ? 0 : 1;
+                            int time = 0;
+                            if (month == semester.month)
+                            {
+                                time = day >= semester.day ? 0 : 1;
+                            }
+                            else
+                            {
+                                time = month > semester.month ? 0 : 1;
+                            }
                             int eyear = year - time;
                             gradeId = (eyear - cyear).ToString();
                         }