diff --git a/api/service/orderServicePackage.go b/api/service/orderServicePackage.go index 4c311a0..0bbdab9 100644 --- a/api/service/orderServicePackage.go +++ b/api/service/orderServicePackage.go @@ -378,17 +378,8 @@ func (r *OrderServicePackageService) CancelOrderServicePackage(req requests.Canc refundId = "模拟退款:" + strconv.FormatInt(global.Snowflake.Generate().Int64(), 10) refundStatus = 3 successTime = time.Now() - - // 模拟退款时手动退还优惠卷 - if orderInquiry.CouponAmountTotal > 0 { - orderService := OrderService{} - res, err := orderService.ReturnOrderCoupon(orderInquiry.InquiryNo, tx) - if err != nil || !res { - // 退还优惠卷失败 - tx.Rollback() - return false, err - } - } + // 退款编号 + refundNo = strconv.FormatInt(global.Snowflake.Generate().Int64(), 10) // 修改订单为取消 orderData := make(map[string]interface{}) @@ -423,7 +414,7 @@ func (r *OrderServicePackageService) CancelOrderServicePackage(req requests.Canc RefundNo: refundNo, RefundId: refundId, RefundStatus: refundStatus, - RefundTotal: *req.RefundAmount, + RefundTotal: orderInquiry.PaymentAmountTotal, RefundReason: req.CancelRemarks, } @@ -446,7 +437,7 @@ func (r *OrderServicePackageService) CancelOrderServicePackage(req requests.Canc InquiryRefundNo: refundNo, RefundId: refundId, InquiryRefundStatus: refundStatus, - RefundTotal: *req.RefundAmount, + RefundTotal: orderInquiry.PaymentAmountTotal, RefundReason: req.CancelRemarks, SuccessTime: model.LocalTime(successTime), }