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 {