From 65a96e5dfb71fb8f11d5060e2e9465df6c69fe61 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Mon, 1 Aug 2022 15:43:55 +0800 Subject: [PATCH] add pay --- business/jxstore/cms/order.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/business/jxstore/cms/order.go b/business/jxstore/cms/order.go index adf40d785..d88d7940d 100644 --- a/business/jxstore/cms/order.go +++ b/business/jxstore/cms/order.go @@ -81,10 +81,15 @@ func CreateOrder(ctx *jxcontext.Context, type1, orderType int, way string, price } func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, appId string, payPrice int) (result *financial.WxPayParam, err error) { + orderInfo, err := dao.GetOrderByID(dao.GetDB(), orderID) + if err != nil { + return nil, err + } var ( db = dao.GetDB() order = &model.Order{ - OrderID: orderID, + OrderID: orderID, + PayPrice: orderInfo.PayPrice, } payHandler = &financial.PayHandler{ PayType: payType, @@ -93,10 +98,7 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app } ) globals.SugarLogger.Debug("payPrice before1111=========================", payPrice) - orderInfo, err := dao.GetOrderByID(db, orderID) - if err != nil { - return nil, err - } + //支付金额<原金额 globals.SugarLogger.Debug("order.PayPrice=========================", order.PayPrice) if payPrice < order.PayPrice {