6
0
Fork 0

修改发起售后判断

release
vine_liutk 2022-03-03 16:57:59 +08:00
parent 372158ed76
commit 1777186ba6
1 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,8 @@ class AfterSaleService
throw new BizException('赠品不能发起退款/退款退货操作');
}
if ($orderProduct->order->total_amount == 0 && in_array($params['type'], [AfterSale::TYPE_REFUND, Aftersale::TYPE_REFUND_AND_RETURN])) {
throw new BizException('订单支付金额为0的商品不能发起退款/退款退货操作');
if ($orderProduct->order->is_change && 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);