fix:app提现扣税

master
howell 3 years ago
parent a1c001a793
commit 66831894da

@ -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 {

Loading…
Cancel
Save