diff --git a/app/hdl/hdl_points_center.go b/app/hdl/hdl_points_center.go index 82be4f9..43ac32e 100644 --- a/app/hdl/hdl_points_center.go +++ b/app/hdl/hdl_points_center.go @@ -465,11 +465,7 @@ func ExchangeEnergy(c *gin.Context) { e.OutErr(c, e.ERR_UNMARSHAL, err.Error()) return } - amount, ok := energyAmount.Div(nowPrice).Float64() - if !ok { - e.OutErr(c, e.ERR_UNMARSHAL, nil) - return - } + amount, _ := energyAmount.Div(nowPrice).Float64() // 3. 获取用户蛋蛋能量余额 eggEnergyAmount, err := rule.GetUserCoinAmount(session, coinID, user.Id) @@ -481,6 +477,7 @@ func ExchangeEnergy(c *gin.Context) { // 4. 判断蛋蛋能量是否足够兑换 if utils.StrToFloat64(eggEnergyAmount) < utils.StrToFloat64(req.EnergyAmount) { e.OutErr(c, e.ERR_BALANCE_NOT_ENOUGH, nil) + return } // 5. 调用降价公式 diff --git a/app/md/md_member_center.go b/app/md/md_member_center.go index 9369722..3f7478e 100644 --- a/app/md/md_member_center.go +++ b/app/md/md_member_center.go @@ -9,7 +9,7 @@ type MemberCenterGetBasicResp struct { EggEnergyValue string `json:"egg_energy_value"` // 能量预估价值 ContributionValue string `json:"contribution_value"` // 贡献值 Date string `json:"date"` // 兑换时间(每月x日) - Ratio string `json:"ratio"` // 兑换比例(x:y) + Ratio string `json:"ratio"` // 能量值兑换比例(x:y) Amount string `json:"amount"` // 账户余额 Id string `json:"id"` Phone string `json:"phone"`