Ver Fonte

fix:卓创红期最新日期

zqbao há 7 meses atrás
pai
commit
73702e6875
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      models/base_from_sci_hq.go

+ 5 - 2
models/base_from_sci_hq.go

@@ -252,12 +252,15 @@ func GetSciHqIndexInfoMaxAndMinInfo(indexCode string) (item *EdbInfoMaxAndMinInf
 
 	// 获取最新值
 	var latest_value float64
-	sql = ` SELECT value AS latest_value FROM base_from_sci_hq_data WHERE index_code=? ORDER BY data_time DESC LIMIT 1 `
-	err = o.Raw(sql, indexCode).QueryRow(&latest_value)
+	var latestDate string
+
+	sql = ` SELECT value AS latest_value, data_time AS latest_date FROM base_from_sci_hq_data WHERE index_code=? ORDER BY data_time DESC LIMIT 1 `
+	err = o.Raw(sql, indexCode).QueryRow(&latest_value, &latestDate)
 	if err != nil {
 		return
 	}
 	item.LatestValue = latest_value
+	item.LatestDate = latestDate
 
 	return
 }