From 3db64afc7f401f0b7f6e93cc298d9735297900f0 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Thu, 4 Apr 2024 18:20:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=92=B1=E5=8C=85=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E9=9D=9E=E8=B4=A7=E5=B8=81=E5=BD=A2=E5=BC=8F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=A2=9D=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/topup.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controller/topup.go b/controller/topup.go index 438c198..37f6c88 100644 --- a/controller/topup.go +++ b/controller/topup.go @@ -111,9 +111,13 @@ func RequestEpay(c *gin.Context) { c.JSON(200, gin.H{"message": "error", "data": "拉起支付失败"}) return } + amount := req.Amount + if !common.DisplayInCurrencyEnabled { + amount = amount / int(common.QuotaPerUnit) + } topUp := &model.TopUp{ UserId: id, - Amount: req.Amount, + Amount: amount, Money: payMoney, TradeNo: "A" + tradeNo, CreateTime: time.Now().Unix(),