Ver código fonte

update

master
shenjiachi 2 semanas atrás
pai
commit
82d43b9eb8
2 arquivos alterados com 3 adições e 6 exclusões
  1. +2
    -5
      app/hdl/hdl_points_center.go
  2. +1
    -1
      app/md/md_member_center.go

+ 2
- 5
app/hdl/hdl_points_center.go Ver arquivo

@@ -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. 调用降价公式


+ 1
- 1
app/md/md_member_center.go Ver arquivo

@@ -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"`


Carregando…
Cancelar
Salvar