diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index b0fe73c..7fdc2e6 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -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")