diff --git a/app/Services/AfterSaleService.php b/app/Services/AfterSaleService.php index 74aea429..d2f217cb 100644 --- a/app/Services/AfterSaleService.php +++ b/app/Services/AfterSaleService.php @@ -47,6 +47,10 @@ class AfterSaleService throw new BizException('申请售后的数量不能大于订单商品数量'); } + if ($orderProduct->isGift() && in_array($params['type'], [AfterSale::TYPE_REFUND, Aftersale::TYPE_REFUND_AND_RETURN])) { + throw new BizException('赠品不能发起退款/退款退货操作'); + } + $amount = ($num == $orderProduct->quantity) ? $orderProduct->total_amount : bcmul(bcdiv($orderProduct->total_amount, $orderProduct->quantity), $num); if ($amount == 0 && in_array($params['type'], [AfterSale::TYPE_REFUND])) {