diff --git a/app/svc/svc_home_page.go b/app/svc/svc_home_page.go index 41f4b97..8941652 100644 --- a/app/svc/svc_home_page.go +++ b/app/svc/svc_home_page.go @@ -22,7 +22,10 @@ func CalcTodayEggEnergyPriceRises(engine *xorm.Engine, now time.Time) (err error return err, 0, false, "", "" } initialPrice = m.Price - yesterdayPrice, _ := decimal.NewFromString(m.Price) + if initialPrice == "" { + initialPrice = "1" + } + yesterdayPrice, _ := decimal.NewFromString(initialPrice) coreDataDb := implement.NewEggEnergyCoreDataDb(db.Db) coreData, err := coreDataDb.EggEnergyCoreDataGet() if err != nil {