diff --git a/modules/player/controller/admin/gold_list.go b/modules/player/controller/admin/gold_list.go index 5671c6ba..709d2546 100644 --- a/modules/player/controller/admin/gold_list.go +++ b/modules/player/controller/admin/gold_list.go @@ -44,7 +44,7 @@ func (c *GoldListController) DuihuanGold(ctx context.Context, req *DuihuanGoldAd } costfree := r.Rate * float64(r.ExchangeNum) - getgold := 1 / r.Rate * float64(r.ExchangeNum) + if base.NewBaseSysUserService().GetFreeGold(t.UserId) < int64(costfree*100) { err = fmt.Errorf("余额不足") return @@ -54,7 +54,7 @@ func (c *GoldListController) DuihuanGold(ctx context.Context, req *DuihuanGoldAd return } base.NewBaseSysUserService().DuihuanFreeGold(uint32(r.PlayerID), int64(r.ExchangeNum*100), int64(costfree*95)) - base.NewBaseSysUserService().DuihuanGold(uint32(t.UserId), int64(getgold*95), int64(costfree*100)) + base.NewBaseSysUserService().DuihuanGold(uint32(t.UserId), int64(r.ExchangeNum*95), int64(costfree*100)) res = cool.Ok(nil) return }