From 2b215a615c5ddb36f13f0cb36da583613c4adb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Mon, 27 Dec 2021 19:12:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98=E6=88=90?= =?UTF-8?q?=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PayService.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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,