修改退还用户优惠卷
This commit is contained in:
parent
81d90bbe5e
commit
fec6306b3c
@ -176,7 +176,7 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
|
|||||||
// 模拟退款时手动退还优惠卷
|
// 模拟退款时手动退还优惠卷
|
||||||
if orderInquiry.CouponAmountTotal > 0 {
|
if orderInquiry.CouponAmountTotal > 0 {
|
||||||
orderService := OrderService{}
|
orderService := OrderService{}
|
||||||
res, err := orderService.ReturnOrderCoupon(orderInquiry.InquiryNo, tx)
|
res, err := orderService.ReturnOrderCoupon(orderInquiry.OrderId, tx)
|
||||||
if err != nil || !res {
|
if err != nil || !res {
|
||||||
// 退还优惠卷失败
|
// 退还优惠卷失败
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
|
|||||||
@ -409,13 +409,13 @@ func (r *OrderService) PdfToImg() (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ReturnOrderCoupon 退还用户优惠卷
|
// ReturnOrderCoupon 退还用户优惠卷
|
||||||
func (r *OrderService) ReturnOrderCoupon(orderNo string, tx *gorm.DB) (bool, error) {
|
func (r *OrderService) ReturnOrderCoupon(orderId int64, tx *gorm.DB) (bool, error) {
|
||||||
orderCouponDao := dao.OrderCouponDao{}
|
orderCouponDao := dao.OrderCouponDao{}
|
||||||
userCouponDao := dao.UserCouponDao{}
|
userCouponDao := dao.UserCouponDao{}
|
||||||
|
|
||||||
// 获取该订单全部优惠卷数据
|
// 获取该订单全部优惠卷数据
|
||||||
maps := make(map[string]interface{})
|
maps := make(map[string]interface{})
|
||||||
maps["order_no"] = orderNo
|
maps["order_id"] = orderId
|
||||||
orderCoupons, err := orderCouponDao.GetOrderCouponList(maps)
|
orderCoupons, err := orderCouponDao.GetOrderCouponList(maps)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
|||||||
@ -227,7 +227,7 @@ func (r *OrderProductService) CancelOrderProduct(req requests.CancelOrderProduct
|
|||||||
// 模拟退款时手动退还优惠卷
|
// 模拟退款时手动退还优惠卷
|
||||||
if orderProduct.CouponAmountTotal > 0 {
|
if orderProduct.CouponAmountTotal > 0 {
|
||||||
orderService := OrderService{}
|
orderService := OrderService{}
|
||||||
res, err := orderService.ReturnOrderCoupon(orderProduct.OrderProductNo, tx)
|
res, err := orderService.ReturnOrderCoupon(orderProduct.OrderId, tx)
|
||||||
if err != nil || !res {
|
if err != nil || !res {
|
||||||
// 退还优惠卷失败
|
// 退还优惠卷失败
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
|
|||||||
@ -285,7 +285,7 @@ func (r *OrderServicePackageService) CancelOrderServicePackage(req requests.Canc
|
|||||||
// 模拟退款时手动退还优惠卷
|
// 模拟退款时手动退还优惠卷
|
||||||
if orderServicePackage.CouponAmountTotal > 0 {
|
if orderServicePackage.CouponAmountTotal > 0 {
|
||||||
orderService := OrderService{}
|
orderService := OrderService{}
|
||||||
res, err := orderService.ReturnOrderCoupon(orderServicePackage.OrderServiceNo, tx)
|
res, err := orderService.ReturnOrderCoupon(orderServicePackage.OrderId, tx)
|
||||||
if err != nil || !res {
|
if err != nil || !res {
|
||||||
// 退还优惠卷失败
|
// 退还优惠卷失败
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user