6
0
Fork 0

添加金额为0的商品无法发起退款流程

release
vine_liutk 2021-12-28 17:46:14 +08:00
parent bde3409681
commit 8629c94c2c
1 changed files with 4 additions and 0 deletions

View File

@ -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,