From 1bbe212c778cf9a0d756abdd67589a67fc2a5a2c Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 8 Aug 2023 18:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B0=83=E8=AF=95=E8=BD=AC?= =?UTF-8?q?=E5=94=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/community/CommunityRepository.php | 2 ++ app/listener/paySuccessOrder.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/community/CommunityRepository.php b/app/common/repositories/community/CommunityRepository.php index 9d5888e4..449a9f71 100644 --- a/app/common/repositories/community/CommunityRepository.php +++ b/app/common/repositories/community/CommunityRepository.php @@ -556,6 +556,7 @@ class CommunityRepository extends BaseRepository */ public function resale($id, array $data) { + $insert = []; foreach ($data as $value) { if (isset($value['id'])) { @@ -575,6 +576,7 @@ class CommunityRepository extends BaseRepository if (($purchaseRecord['number'] - $purchaseRecord['sales_volume']) < $value['number']) { throw new ValidateException('库存不足'); } + if ($value) { $insert[] = [ 'community_id' => $id, diff --git a/app/listener/paySuccessOrder.php b/app/listener/paySuccessOrder.php index 60ba749f..fd7db763 100644 --- a/app/listener/paySuccessOrder.php +++ b/app/listener/paySuccessOrder.php @@ -150,7 +150,7 @@ class paySuccessOrder 'order_sn' => $orderSn, ]; $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL,$postUrl); + curl_setopt($ch, CURLOPT_URL, $postUrl); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1);