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);