取消后更新订单状态

This commit is contained in:
richboo111
2022-07-27 18:13:39 +08:00
parent cb72da4031
commit c7ef385ba0

View File

@@ -254,12 +254,6 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
// 微信支付原路退款,发起退款申请
res, err := RefundOrderByTL(ctx, orderWay, order, order.OtherWayBill, int(order.ChannelFee*100), "申请退款")
if len(res.VendorRefundID) > 0 {
if _, err := dao.SetUserVendorOrderStatus(db, tmp_orderNo, 150); err != nil {
return FailCode, err
}
if _, err := dao.SetOrderStatus(db, orderWay.OrderID, 150); err != nil {
return FailCode, err
}
return SuccessCode, err
} else {
return FailCode, err
@@ -453,6 +447,11 @@ func RefundOrderByTL(ctx *jxcontext.Context, orderPay *model.Order, order *model
dao.Rollback(db, tx)
return nil, err
}
orderPay.Status = model.OrderStatusCancel
if _, err := dao.UpdateEntityTx(tx, orderPay); err != nil {
dao.Rollback(db, tx)
return nil, err
}
dao.Commit(db, tx)
}