6
0
Fork 0

添加赠品不能发起退款/退款退货售后操作

release
vine_liutk 2021-12-28 21:29:00 +08:00
parent c610d058f3
commit 8b3de12160
1 changed files with 4 additions and 0 deletions

View File

@ -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])) {