diff --git a/app/Services/PayService.php b/app/Services/PayService.php index 15965af7..49bd45f6 100644 --- a/app/Services/PayService.php +++ b/app/Services/PayService.php @@ -49,16 +49,20 @@ class PayService if ($payLog->payable instanceof Order) { $order = $payLog->payable; + if ($order->isPaid()) { + throw new BizException('订单已支付'); + } + + if ($order->isCompleted()) { + throw new BizException('订单已完成'); + } + // 支付方式 $payWay = $payLog->pay_way; if ($payLog->isWxpay()) { $payWay = Order::PAY_WAY_WXPAY; } - if (! $order->isPending()) { - throw new BizException('订单状态不是待支付'); - } - $order->update([ 'pay_sn' => $payLog->pay_sn, 'pay_way' => $payWay,