فهرست منبع

Merge branch '14.7.1'

Roc 1 سال پیش
والد
کامیت
36e41a5af0
1فایلهای تغییر یافته به همراه16 افزوده شده و 4 حذف شده
  1. 16 4
      controllers/chart.go

+ 16 - 4
controllers/chart.go

@@ -137,13 +137,19 @@ func (this *ChartController) ChartInfoDetail() {
 
 	if chartType == 2 {
 		if seasonStartDate != "" {
-			startDate = seasonStartDate + "-01-01"
+			startDate = seasonStartDate + "-01"
 		} else {
 			fivePre := time.Now().AddDate(-4, 0, 0).Year()
 			startDate = strconv.Itoa(fivePre) + "-01-01"
 		}
 		if seasonEndDate != "" {
-			endDate = seasonEndDate + "-12-31"
+			seasonEndDateTime, tmpErr := time.ParseInLocation(utils.FormatDate, seasonEndDate+"-01", time.Local)
+			if tmpErr != nil {
+				br.Msg = "获取失败"
+				br.ErrMsg = "获取图表,指标信息失败,Err:" + tmpErr.Error()
+				return
+			}
+			endDate = seasonEndDateTime.AddDate(0, 1, -1).Format(utils.FormatDate)
 		} else {
 			//endDate = time.Now().Format(utils.FormatDate)
 			endDate = ""
@@ -404,13 +410,19 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *models.ChartInfo, key string) (
 
 	if chartType == 2 {
 		if seasonStartDate != "" {
-			startDate = seasonStartDate + "-01-01"
+			startDate = seasonStartDate + "-01"
 		} else {
 			fivePre := time.Now().AddDate(-4, 0, 0).Year()
 			startDate = strconv.Itoa(fivePre) + "-01-01"
 		}
 		if seasonEndDate != "" {
-			endDate = seasonEndDate + "-12-31"
+			seasonEndDateTime, tmpErr := time.ParseInLocation(utils.FormatDate, seasonEndDate+"-01", time.Local)
+			if tmpErr != nil {
+				msg = "获取失败"
+				errMsg = "获取图表,指标信息失败,Err:" + tmpErr.Error()
+				return
+			}
+			endDate = seasonEndDateTime.AddDate(0, 1, -1).Format(utils.FormatDate)
 		} else {
 			//endDate = time.Now().Format(utils.FormatDate)
 			endDate = ""