From e9225a2a2fc0df3ac8aa57baf0ff44439592f71b Mon Sep 17 00:00:00 2001 From: richboo111 Date: Mon, 1 Aug 2022 15:35:20 +0800 Subject: [PATCH] add pay --- business/jxstore/cms/order.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/business/jxstore/cms/order.go b/business/jxstore/cms/order.go index d61b2a89e..c4272f4e4 100644 --- a/business/jxstore/cms/order.go +++ b/business/jxstore/cms/order.go @@ -92,6 +92,10 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app VendorPayType: vendorPayType, } ) + orderInfo, err := dao.GetOrderByID(db, orderID) + if err != nil { + return nil, err + } //支付金额<原金额 globals.SugarLogger.Debug("order.PayPrice=========================", order.PayPrice) if payPrice < order.PayPrice { @@ -103,6 +107,7 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app } else { order = &model.Order{ OrderID: orderID, + PayPrice: orderInfo.PayPrice, PayMethod: 2, //微信支付 } } @@ -212,6 +217,7 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int, globals.SugarLogger.Debug("进入混合支付部分") //orderInfo.PayMethod = 5 //混合支付状态 needPay := totalPrice - userBill.AccountBalance //需支付金额 + globals.SugarLogger.Debug("needPay=================", needPay) globals.SugarLogger.Debug("orderInfo.PayPrice=================", orderInfo.PayPrice) globals.SugarLogger.Debug("orderInfo.OrderID=================", orderInfo.OrderID) WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, needPay)