From 8b3de1216031da26461e9fc506dadca5765191c1 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Tue, 28 Dec 2021 21:29:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B5=A0=E5=93=81=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=8F=91=E8=B5=B7=E9=80=80=E6=AC=BE/=E9=80=80?= =?UTF-8?q?=E6=AC=BE=E9=80=80=E8=B4=A7=E5=94=AE=E5=90=8E=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/AfterSaleService.php | 4 ++++ 1 file changed, 4 insertions(+) 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])) {