Преглед изворни кода

fix:兼容数据类型为2022-09的错误

Roc пре 2 година
родитељ
комит
440fc69dc2
2 измењених фајлова са 5 додато и 0 уклоњено
  1. 1 0
      .gitignore
  2. 4 0
      controller/chart/chart_info.go

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@
 /log
 latest_log
 /config/config.yaml
+/config/config_release.yaml
 .DS_Store
 go.sum
 /binlog

+ 4 - 0
controller/chart/chart_info.go

@@ -110,6 +110,10 @@ func GetChartInfoDetail(c *gin.Context) {
 		} else {
 			startDate = startDate + "-01"
 		}
+		//兼容日期数据为2022-09的错误
+		if strings.Count(startDate, "-") == 1 {
+			startDate = startDate + "-01"
+		}
 	case 7:
 		startDate = "2018-01-01"
 	case 8: