|
|
@@ -48,10 +48,10 @@ func DealUserWallet(session *xorm.Session, req md.DealUserWalletReq) (err error) |
|
|
|
|
|
|
|
if req.Direction == "add" { |
|
|
|
userWalletFlow.Direction = 1 |
|
|
|
userWalletFlow.AfterAmount = beforeAmountValue.Add(amountValue).RoundFloor(8).String() |
|
|
|
userWalletFlow.AfterAmount = beforeAmountValue.Add(amountValue).RoundFloor(2).String() |
|
|
|
} else if req.Direction == "sub" { |
|
|
|
userWalletFlow.Direction = 2 |
|
|
|
userWalletFlow.AfterAmount = beforeAmountValue.Sub(amountValue).RoundFloor(8).String() |
|
|
|
userWalletFlow.AfterAmount = beforeAmountValue.Sub(amountValue).RoundFloor(2).String() |
|
|
|
if zhios_order_relate_utils.StrToFloat64(userWalletFlow.AfterAmount) < 0 { |
|
|
|
return errors.New("用户钱包余额不足") |
|
|
|
} |
|
|
|