Browse Source

update exchange energy

tmp
shenjiachi 3 weeks ago
parent
commit
5e65ebe507
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      app/hdl/hdl_points_center.go
  2. +1
    -0
      app/svc/svc_home_page.go

+ 1
- 1
app/hdl/hdl_points_center.go View File

@@ -465,7 +465,7 @@ func ExchangeEnergy(c *gin.Context) {
e.OutErr(c, e.ERR_UNMARSHAL, err.Error()) e.OutErr(c, e.ERR_UNMARSHAL, err.Error())
return return
} }
amount, _ := energyAmount.Div(nowPrice).Float64()
amount, _ := energyAmount.Mul(nowPrice).Float64()


// 3. 获取用户蛋蛋能量余额 // 3. 获取用户蛋蛋能量余额
eggEnergyAmount, err := rule.GetUserCoinAmount(session, coinID, user.Id) eggEnergyAmount, err := rule.GetUserCoinAmount(session, coinID, user.Id)


+ 1
- 0
app/svc/svc_home_page.go View File

@@ -22,6 +22,7 @@ func CalcTodayEggEnergyPriceRises(engine *xorm.Engine, now time.Time) (err error
return err, 0, false, "", "" return err, 0, false, "", ""
} }
initialPrice = m.Price initialPrice = m.Price
// todo 有数据后不需要此判断
if initialPrice == "" { if initialPrice == "" {
initialPrice = "1" initialPrice = "1"
} }


Loading…
Cancel
Save