浏览代码

fix: 图表

hsun 3 年之前
父节点
当前提交
cbb143d38b
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      models/tables/edb_data/query.go

+ 6 - 4
models/tables/edb_data/query.go

@@ -116,8 +116,9 @@ func GetEdbDataList(source, endInfoId int, startDate, endDate string) (list []*E
 	if len(list) > 0 {
 		for _, row := range list {
 			if row.DataTime != "" {
-				tempTime, _ := time.Parse("2006-01-02T00:00:00", row.DataTime)
-				row.DataTime = tempTime.Format(utils.FormatDate)
+				row.DataTime = row.DataTime[:10]	// 此处获取的字符串row.DataTime长度有长有短,截取年月日
+				//tempTime, _ := time.Parse("2006-01-02T00:00:00+08:00", row.DataTime)
+				//row.DataTime = tempTime.Format(utils.FormatDate)
 			}
 		}
 	}
@@ -630,8 +631,9 @@ func GetEdbDataListAll(condition string, pars []interface{}, source, order int)
 	if len(item) > 0 {
 		for _, row := range item {
 			if row.DataTime != "" {
-				tempTime, _ := time.Parse("2006-01-02T00:00:00", row.DataTime)
-				row.DataTime = tempTime.Format(utils.FormatDate)
+				row.DataTime = row.DataTime[:10]
+				//tempTime, _ := time.Parse("2006-01-02T00:00:00", row.DataTime)
+				//row.DataTime = tempTime.Format(utils.FormatDate)
 			}
 		}
 	}