From 80fa23f2d34dcf796805461b901b7551d84eedf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Mon, 28 Aug 2023 17:07:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#10000=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Ship/WayBillService.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Services/Ship/WayBillService.php b/app/Services/Ship/WayBillService.php index d8a86f0..1b4d811 100644 --- a/app/Services/Ship/WayBillService.php +++ b/app/Services/Ship/WayBillService.php @@ -34,11 +34,11 @@ class WayBillService $faceSheet = new FaceSheet(); $faceSheet->setShop($shopShip); foreach ($order as $item) { - [$sender, $orderInfo, $wpCode] = $this->prepareRequest($item, $shopShip); - $waybill = $this->saveWayBill($item, $shopShip, $sender); + [$sender, $orderInfo, $senderConfig] = $this->prepareRequest($item, $shopShip); + $waybill = $this->saveWayBill($item, $shopShip, $senderConfig); if (empty($waybill->id)) { - $resp = $faceSheet->getWayBill($sender, $orderInfo, $wpCode); + $resp = $faceSheet->getWayBill($sender, $orderInfo, $senderConfig['wp_code']); if (isset($resp['pdd_waybill_get_response'])) { $data = $resp['pdd_waybill_get_response']['modules'][0]; $printData = json_decode($data['print_data'], true); @@ -151,7 +151,7 @@ class WayBillService return $waybill; } - private function getTimedDelivery($orderItem) + private function getTimedDelivery($order) { $this->timedDeliveryCode = Waybill::$BUSINESS_EXPRESS_CODE; $address = [ @@ -167,11 +167,11 @@ class WayBillService '西宁市', '海东市', '海北藏族自治州', '黄南藏族自治州', '海南藏族自治州', '玉树藏族自治州' ], ]; - if (isset($address[$orderItem['recipient_province']])) { - if (empty($address[$orderItem['recipient_province']])) { + if (isset($address[$order['recipient_province']])) { + if (empty($address[$order['recipient_province']])) { $this->timedDeliveryCode = Waybill::$AIR_FREIGHT_CODE; } - if ($address[$orderItem['recipient_province']] && in_array($orderItem['recipient_city'], $address[$orderItem['recipient_province']], true)) { + if ($address[$order['recipient_province']] && in_array($order['recipient_city'], $address[$order['recipient_province']], true)) { $this->timedDeliveryCode = Waybill::$AIR_FREIGHT_CODE; } } @@ -249,7 +249,7 @@ class WayBillService 'user_id' => $shopShip->owner_id, ]; - return [$senderConfig, $orderInfo, $senderConfig['wp_code']]; + return [$sender, $orderInfo, $senderConfig]; } public function setObjectId()