This commit is contained in:
richboo111
2022-08-03 10:44:30 +08:00
parent bfdc340a77
commit 37337b9611
2 changed files with 3 additions and 25 deletions

View File

@@ -110,43 +110,19 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app
if payPrice < order.PayPrice {
temp_PayPrice = payPrice
temp_PayMethod = 5
//order = &model.Order{
// OrderID: orderID,
// PayPrice: payPrice,
// UserID: orderInfo.UserID,
// PayMethod: 5, //混合支付
//}
} else {
temp_PayPrice = orderInfo.PayPrice
temp_PayMethod = 2
//order = &model.Order{
// OrderID: orderID,
// PayPrice: orderInfo.PayPrice,
// UserID: orderInfo.UserID,
// PayMethod: 2, //微信支付
//}
}
globals.SugarLogger.Debug("检验初始数据情况", order.OrderID, order.PayMethod)
globals.SugarLogger.Debug("检验初始数据情况", order.PayPrice)
//txDB, _ := dao.Begin(db)
//defer func() {
// if r := recover(); r != nil {
// panic(r)
// }
//}()
//微信支付实际金额更新到数据库
if _, err := dao.SetOrderStatus(temp_PayPrice, temp_PayMethod, orderID); err != nil {
return nil, err
}
if _, err := dao.UpdateEntityTx(txDB, order); err != nil {
//dao.Rollback(db, txDB)
return nil, err
}
//if _, err := dao.UpdateEntityTx(txDB, &order, "PayMethod"); err != nil {
// dao.Rollback(db, txDB)
// return nil, err
//}
//dao.Commit(db, txDB)
globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.OrderID, order.PayPrice, order.PayMethod)
globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.PayPrice)
globals.SugarLogger.Debugf("pay begin……")

View File

@@ -250,10 +250,12 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
if err != nil {
return FailCode, err
}
globals.SugarLogger.Debug("回调获取order详情", orderWay)
userBill, err := dao.GetUserBill(db, orderWay.UserID, "")
if err != nil {
return FailCode, err
}
globals.SugarLogger.Debug("回调获取user_bill详情", userBill)
if orderWay.Status == 110 {
if orderWay.PayMethod == 1 { // 余额支付
txDB, _ := dao.Begin(db)
@@ -294,7 +296,7 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
}
//更新mixPay 状态
mixPayInfo[0].Status = model.BillMixPayRefund1 //退款状态
mixPayInfo[0].Status = -1 //model.BillMixPayRefund1 //退款状态
if _, err := dao.UpdateEntityTx(txDB, &mixPayInfo, "Status"); err != nil {
return FailCode, err
}