Browse Source

统计天数调整

xyxie 1 year ago
parent
commit
51a983f22d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      models/edb_data_calculate_rjz.go

+ 3 - 3
models/edb_data_calculate_rjz.go

@@ -287,13 +287,13 @@ func GetRjzFrequencyDays(currDate time.Time, frequency string) (days int, err er
 		} else {
 			// 下旬,多种可能,最大天数可能存在8天,9天,10天,11天,
 			currT := time.Date(currDate.Year(), currDate.Month(), 20, 0, 0, 0, 0, time.Local)
-			nextT := time.Date(currDate.Year(), currDate.Month()+1, 1, 0, 0, 0, 0, time.Local).AddDate(0, 0, -1)
+			nextT := time.Date(currDate.Year(), currDate.Month()+1, 1, 0, 0, 0, 0, time.Local)
 			days = utils.GetTimeSubDay(currT, nextT)
 		}
 	case "月度":
 		//统计当月的天数
 		currMonthFd := time.Date(currDate.Year(), currDate.Month(), 1, 0, 0, 0, 0, time.Local)
-		nextMonthFd := time.Date(currDate.Year(), currDate.Month()+1, 1, 0, 0, 0, 0, time.Local).AddDate(0, 0, -1)
+		nextMonthFd := time.Date(currDate.Year(), currDate.Month()+1, 1, 0, 0, 0, 0, time.Local)
 		days = utils.GetTimeSubDay(currMonthFd, nextMonthFd)
 	case "季度":
 		curr0T := time.Date(currDate.Year(), 1, 1, 0, 0, 0, 0, time.Local)
@@ -315,7 +315,7 @@ func GetRjzFrequencyDays(currDate time.Time, frequency string) (days int, err er
 	case "年度":
 		//统计当前年份的天数,明年1月1日-今天年1月1日
 		currentYearFd := time.Date(currDate.Year(), 1, 1, 0, 0, 0, 0, time.Local)
-		nextYearFd := currentYearFd.AddDate(1, 0, 0).AddDate(0, 0, -1)
+		nextYearFd := currentYearFd.AddDate(1, 0, 0)
 		days = utils.GetTimeSubDay(currentYearFd, nextYearFd)
 	case "半年度":