This commit is contained in:
richboo111
2022-09-20 17:40:06 +08:00
parent 40ab9dc95d
commit eaab50c8b2

View File

@@ -165,7 +165,8 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int,
//快递混合支付 //快递混合支付
if orderInfo.OrderType == model.OrderTypeDelivery { if orderInfo.OrderType == model.OrderTypeDelivery {
// (3)使用余额且 余额大于支付金额 // (3)使用余额且 余额大于支付金额
if userBill.AccountBalance > 0 && userBill.AccountBalance > orderInfo.PayPrice && isChoose == model.PayChooseBalance { if isChoose == model.PayChooseBalance {
if userBill.AccountBalance > 0 && userBill.AccountBalance > orderInfo.PayPrice {
globals.SugarLogger.Debug("进入余额支付部分") globals.SugarLogger.Debug("进入余额支付部分")
txDB, _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
@@ -214,7 +215,8 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int,
} else { } else {
return nil, "order/user_vendor_order更新状态出错", nil return nil, "order/user_vendor_order更新状态出错", nil
} }
} else if isChoose == model.PayChooseBalance && userBill.AccountBalance < orderInfo.PayPrice { } else {
//else if isChoose == model.PayChooseBalance && userBill.AccountBalance < orderInfo.PayPrice {
//1用户选中余额 但余额<订单总价 需混合微信支付 //1用户选中余额 但余额<订单总价 需混合微信支付
if userBill.AccountBalance == 0 { if userBill.AccountBalance == 0 {
WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, orderInfo.PayPrice) WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, orderInfo.PayPrice)
@@ -234,7 +236,9 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int,
return WxPayParam, "", err return WxPayParam, "", err
} }
} }
} else if isChoose == model.PayNotChooseBalance { }
}
if isChoose == model.PayNotChooseBalance {
//4不选中余额支付 即直接微信支付 //4不选中余额支付 即直接微信支付
globals.SugarLogger.Debug("进入PayNotChooseBalance==================") globals.SugarLogger.Debug("进入PayNotChooseBalance==================")
WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, orderInfo.PayPrice) WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, orderInfo.PayPrice)