From 66831894da9a8600dc815ba9bd2e4d1c044bed69 Mon Sep 17 00:00:00 2001 From: howell <2827207845@qq.com> Date: Fri, 18 Feb 2022 11:06:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:app=E6=8F=90=E7=8E=B0=E6=89=A3=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/api/mobile/wallet/withdraw.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/api/mobile/wallet/withdraw.go b/internal/api/mobile/wallet/withdraw.go index 4cd6e51..28977f3 100644 --- a/internal/api/mobile/wallet/withdraw.go +++ b/internal/api/mobile/wallet/withdraw.go @@ -90,6 +90,8 @@ func SubmitWithdraw(c *gin.Context) { t = user.BankType } tx := dbc.DB.Begin() + amount := decimal.NewFromFloat(p.Amount) + fee := amount.Div(decimal.NewFromFloat(1.13)).Mul(decimal.NewFromFloat(0.13)).Mul(decimal.NewFromFloat(1.12)) err := tx.Create(&user.Withdraw{ UserId: p.UserID, UserName: userInfo.RealName, @@ -100,8 +102,8 @@ func SubmitWithdraw(c *gin.Context) { BankName: p.BankName, AuditTime: formatime.NewSecondFrom(getNextTenOrTwentyFive()), Status: user.UndoneWithdrawStatus, - TaxFee: decimal.Zero, - ActualAmount: decimal.Zero, + TaxFee: fee, + ActualAmount: amount.Sub(fee), }).Error if err != nil {