@@ -352,12 +352,12 @@ func GetPriceCurve(c *gin.Context) {
var sql = fmt.Sprintf("SELECT price,date FROM `egg_energy_price` WHERE HOUR = 23 AND DATE >= \"%s\" AND DATE != \"%s\" ORDER BY DATE ASC ", date, now.Format("2006-01-02"))
results, _ := db.Db.QueryString(sql)
for _, v := range results {
tmpDate := utils.TimeParseStd(v["date"])
tmpDate := utils.TimeParseDate Std(v["date"])
yData = append(yData, v["price"])
xData = append(xData, tmpDate.Format("01-02"))
}
yData = append(yData, m.Price)
tmpDate := utils.TimeParseStd(m.Date)
tmpDate := utils.TimeParseDate Std(m.Date)
xData = append(xData, tmpDate.Format("01-02"))
break
case "2":
@@ -372,11 +372,11 @@ func GetPriceCurve(c *gin.Context) {
// continue
//}
yData = append(yData, results[0]["price"])
xData = append(xData, results[0]["hour"]+":00")
xData = append(xData, results[0]["date"]+" "+results[0][" hour"]+":00")
}
}
yData = append(yData, m.Price)
xData = append(xData, m.Hour+":00")
xData = append(xData, m.Date+" "+m. Hour+":00")
break
case "3":
var nums = 29
@@ -386,14 +386,14 @@ func GetPriceCurve(c *gin.Context) {
sql = fmt.Sprintf(sql, date)
results, _ := db.Db.QueryString(sql)
if results != nil {
tmpDate := utils.TimeParseStd (results[0]["date"])
year, week, _, _ := utils.GetWeekInfoByDate (results[0]["date"])
yData = append(yData, results[0]["price"])
xData = append(xData, tmpDate.Format("01-02" ))
xData = append(xData, fmt.Sprintf("%s年%s周", year, week ))
}
}
yData = append(yData, m.Price)
tmpDate := utils.TimeParseStd (m.Date)
xData = append(xData, tmpDate.Format("01-02" ))
year, week, _, _ := utils.GetWeekInfoByDate (m.Date)
xData = append(xData, fmt.Sprintf("%s年%s周", year, week ))
break
}