浏览代码

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: