Parcourir la source

补充pici 不存在 的数据

wcc il y a 1 an
Parent
commit
16253800c2
1 fichiers modifiés avec 9 ajouts et 6 suppressions
  1. 9 6
      bidding_listen/main.go

+ 9 - 6
bidding_listen/main.go

@@ -235,18 +235,21 @@ func saveBidding(tmp map[string]interface{}) {
 	}
 
 	if tmp["comeintime"] != nil {
-		time, _ := convertToTime(tmp["comeintime"])
-		insert["comeintime"] = time.Format("2006-01-02 15:04:05")
+		ctime, _ := convertToTime(tmp["comeintime"])
+		insert["comeintime"] = ctime.Format("2006-01-02 15:04:05")
 	}
 
 	if tmp["publishtime"] != nil {
-		time, _ := convertToTime(tmp["publishtime"])
-		insert["publishtime"] = time.Format("2006-01-02 15:04:05")
+		putime, _ := convertToTime(tmp["publishtime"])
+		insert["publishtime"] = putime.Format("2006-01-02 15:04:05")
 	}
 
 	if tmp["pici"] != nil {
-		time, _ := convertToTime(tmp["pici"])
-		insert["es_bidding_pici"] = time.Format("2006-01-02 15:04:05")
+		ptime, _ := convertToTime(tmp["pici"])
+		insert["es_bidding_pici"] = ptime.Format("2006-01-02 15:04:05")
+	} else {
+		ctime, _ := convertToTime(tmp["comeintime"])
+		insert["es_bidding_pici"] = ctime.Add(time.Minute * 10).Format("2006-01-02 15:04:05")
 	}
 
 	if utils.IntAll(tmp["extracttype"]) == -1 || utils.IntAll(tmp["dataprocess"]) == 7 {