瀏覽代碼

Merge branch 'feature/eta_forum3_chart_classify' into debug

xyxie 1 周之前
父節點
當前提交
7cdd649f88
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      controllers/edb_data.go

+ 10 - 1
controllers/edb_data.go

@@ -100,7 +100,16 @@ func (this *EdbDataController) SaveByBinlog() {
 		}
 		value, ok := item.Value.(float64)
 		if !ok {
-			continue
+			valueStr, ok:= item.Value.(string)
+			if !ok {
+				utils.FileLog.Info("binlog数据类型异常,Err:" + err.Error(), "item", item)
+				continue
+			}
+			value, err = strconv.ParseFloat(valueStr, 64)
+			if err != nil {
+				utils.FileLog.Info("binlog数据类型转换异常,Err:" + err.Error(), "item", item)
+				continue
+			}
 		}
 		createTime, _ := time.ParseInLocation("2006-01-02 15:04:05", item.CreateTime, time.Local)
 		modifyTime, _ := time.ParseInLocation("2006-01-02 15:04:05", item.ModifyTime, time.Local)