shenjiachi 1 tydzień temu
rodzic
commit
a5da521ba8
1 zmienionych plików z 7 dodań i 3 usunięć
  1. +7
    -3
      app/hdl/institutional_management/egg_energy/hdl_basic.go

+ 7
- 3
app/hdl/institutional_management/egg_energy/hdl_basic.go Wyświetl plik

@@ -543,6 +543,9 @@ func GetPriceCurve(c *gin.Context) {
kind := c.DefaultQuery("kind", "1")
now := time.Now()

var yData []interface{}
var xData []interface{}

priceDb := implement.NewEggEnergyPriceDb(db.Db)
m, has, err := priceDb.EggEnergyPriceGetLastOne()
if err != nil {
@@ -550,12 +553,13 @@ func GetPriceCurve(c *gin.Context) {
return
}
if has == false {
e.OutErr(c, e.ERR_NO_DATA, "未查询到数据")
e.OutSuc(c, md.GetPriceCurveResp{
YData: yData,
XData: xData,
}, nil)
return
}

var yData []interface{}
var xData []interface{}
switch kind {
case "1":
var date = now.AddDate(0, 0, -30).Format("2006-01-02")


Ładowanie…
Anuluj
Zapisz