添加金额为0的商品无法发起退款流程
parent
bde3409681
commit
8629c94c2c
|
|
@ -49,6 +49,10 @@ class AfterSaleService
|
|||
|
||||
$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])) {
|
||||
throw new BizException('实际支付金额为0的商品无法发起退款售后');
|
||||
}
|
||||
|
||||
$afterSale = AfterSale::create(array_merge($params, [
|
||||
'user_id' => $user->id,
|
||||
'order_id' => $orderProduct->order_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue