This commit is contained in:
richboo111
2022-08-01 15:28:10 +08:00
parent edd7949cf4
commit e9f9a68c61

View File

@@ -93,16 +93,22 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app
} }
) )
//支付金额<原金额 //支付金额<原金额
globals.SugarLogger.Debug("order.PayPrice=========================", order.PayPrice)
if payPrice < order.PayPrice { if payPrice < order.PayPrice {
order = &model.Order{ order = &model.Order{
OrderID: orderID,
PayPrice: payPrice, PayPrice: payPrice,
PayMethod: 5, //混合支付 PayMethod: 5, //混合支付
} }
} else { } else {
order = &model.Order{ order = &model.Order{
OrderID: orderID,
PayMethod: 2, //微信支付 PayMethod: 2, //微信支付
} }
} }
globals.SugarLogger.Debug("order.OrderID after=========================", order.OrderID)
globals.SugarLogger.Debug("order.PayPrice after=========================", order.PayPrice)
globals.SugarLogger.Debug("order.PayMethod after=========================", order.PayMethod)
globals.SugarLogger.Debugf("pay begin……") globals.SugarLogger.Debugf("pay begin……")
err = dao.GetEntity(db, order, "OrderID") err = dao.GetEntity(db, order, "OrderID")
if order.ID == 0 { if order.ID == 0 {
@@ -207,6 +213,7 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int,
//orderInfo.PayMethod = 5 //混合支付状态 //orderInfo.PayMethod = 5 //混合支付状态
needPay := totalPrice - userBill.AccountBalance //需支付金额 needPay := totalPrice - userBill.AccountBalance //需支付金额
globals.SugarLogger.Debug("orderInfo.PayPrice=================", orderInfo.PayPrice) globals.SugarLogger.Debug("orderInfo.PayPrice=================", orderInfo.PayPrice)
globals.SugarLogger.Debug("orderInfo.OrderID=================", orderInfo.OrderID)
WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, needPay) WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, needPay)
if err != nil { if err != nil {
globals.SugarLogger.Debug("err=================", err) globals.SugarLogger.Debug("err=================", err)