From 382a32bec4b426bb99345d33973d12c27a4fcc05 Mon Sep 17 00:00:00 2001 From: zhoujunyao Date: Mon, 23 Jun 2025 15:53:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E6=AF=94=E8=BE=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/pay.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/service/bundle/pay.go b/pkg/service/bundle/pay.go index 47801d0..1b0276d 100644 --- a/pkg/service/bundle/pay.go +++ b/pkg/service/bundle/pay.go @@ -234,8 +234,8 @@ func CreateAntomPay(c *gin.Context) { fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100) //金额校验 - orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100))) - reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice))) + orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount) * 100)) + reqAmountInCents := req.ProductAllPrice if orderAmountInCents != reqAmountInCents { fmt.Println("111111111111111111111111111111111111") service.Error(c, errors.New(common.InvalidOrderAmount)) @@ -304,7 +304,7 @@ func CreateAntomPay(c *gin.Context) { orderAmountInCents := int64(0.0) for _, info := range res.AddBundleInfos { - temp := int64(math.Round(float64(info.Amount * 100))) + temp := int64(math.Round(float64(info.Amount) * 100)) orderAmountInCents += temp } @@ -312,7 +312,7 @@ func CreateAntomPay(c *gin.Context) { fmt.Println("req.ProductAllPrice :", req.ProductAllPrice) //金额校验 - reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice))) + reqAmountInCents := req.ProductAllPrice if orderAmountInCents != reqAmountInCents { fmt.Println("111111111111111111111111111111111111") service.Error(c, errors.New(common.InvalidOrderAmount))