From 20e0f50e54438399e78ff98620597f2ad50bb1fc Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 23 Aug 2023 15:40:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderCreateRepository.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 2f149e11..43d77f02 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -110,11 +110,10 @@ class StoreOrderCreateRepository extends StoreOrderRepository throw new ValidateException('转售商品数据异常'); } $community = Db::name('Community')->where('community_id', $communityIdArray[0] ?? 0)->field('community_id, title, image')->fetchSql(false)->find(); - if (!$community) { - throw new ValidateException('转售商品数据异常'); + if ($community) { + $deliverMethod = Db::name('resale')->where('community_id', $communityIdArray[0] ?? 0)->value('deliver_method'); + $deliverMethodArray = explode(',', $deliverMethod); } - $deliverMethod = Db::name('resale')->where('community_id', $communityIdArray[0] ?? 0)->value('deliver_method'); - $deliverMethodArray = explode(',', $deliverMethod); } unset($merchantCart, $cart); $order_price = 0; @@ -137,8 +136,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository $order_svip_discount = 0; // 循环计算每个店铺的订单数据 foreach ($merchantCartList as &$merchantCart) { - if ($order_type == 98) { - $merchantCart['delivery_way'] = $deliverMethodArray ?? []; + if ($order_type == 98 && !empty($deliverMethodArray)) { + $merchantCart['delivery_way'] = $deliverMethodArray; } $postageRule = []; $total_price = 0;