From e95886f47d231405391f2c8a94c25c56ae940ddf Mon Sep 17 00:00:00 2001 From: richboo111 Date: Tue, 20 Sep 2022 17:49:32 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/order.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/business/jxstore/cms/order.go b/business/jxstore/cms/order.go index fa1b7a764..623ea3556 100644 --- a/business/jxstore/cms/order.go +++ b/business/jxstore/cms/order.go @@ -164,9 +164,9 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int, //} //快递混合支付 if orderInfo.OrderType == model.OrderTypeDelivery { - // (3)使用余额且 余额大于支付金额 if isChoose == model.PayChooseBalance { - if userBill.AccountBalance > 0 && userBill.AccountBalance > orderInfo.PayPrice { + // (3)使用余额且 余额大于支付金额 + if userBill.AccountBalance > orderInfo.PayPrice { globals.SugarLogger.Debug("进入余额支付部分") txDB, _ := dao.Begin(db) defer func() { @@ -216,7 +216,6 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int, return nil, "order/user_vendor_order更新状态出错", nil } } else { - //else if isChoose == model.PayChooseBalance && userBill.AccountBalance < orderInfo.PayPrice { //(1)用户选中余额 但余额<订单总价 需混合微信支付 if userBill.AccountBalance == 0 { WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, orderInfo.PayPrice) @@ -226,15 +225,14 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int, return WxPayParam, "", err } else if userBill.AccountBalance > 0 { //(2)用户使用余额,剩余微信支付 - totalPrice := orderInfo.PayPrice //订单原价 - if userBill.AccountBalance > 0 && userBill.AccountBalance < orderInfo.PayPrice { - needPay := totalPrice - userBill.AccountBalance //需支付金额 - WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, needPay) - if err != nil { - return nil, "微信支付失败:", err - } - return WxPayParam, "", err + totalPrice := orderInfo.PayPrice //订单原价 + needPay := totalPrice - userBill.AccountBalance //需支付金额 + globals.SugarLogger.Debug("totalprice=====,needpay=====", totalPrice, needPay) + WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, needPay) + if err != nil { + return nil, "微信支付失败:", err } + return WxPayParam, "", err } } }