From 7710d06f0dff3121379d16445a28629b76191f6f Mon Sep 17 00:00:00 2001 From: ZweiCD <416931358@qq.com> Date: Wed, 8 Apr 2020 15:45:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=B4=A7=E5=8D=95=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8C=87=E5=AE=9A=E5=8F=91=E8=B4=A7=E7=89=A9?= =?UTF-8?q?=E6=B5=81=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/QimenWms.php | 5 ++++- src/XinyiWms.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/QimenWms.php b/src/QimenWms.php index 26092ac..1149c51 100644 --- a/src/QimenWms.php +++ b/src/QimenWms.php @@ -51,6 +51,7 @@ class QimenWms extends BaseWms implements WmsInterface 'shopNick' => $order['order_sender_info']['shop_name'] ?? static::$default_shop_name, 'sellerNick' => $order['order_sender_info']['shop_name'] ?? static::$default_seller_nick, 'remark' => $order['remark'], + 'logisticsCode' => $order['order_express'] ? strtoupper($order['order_express']) : '', //发货人信息 'senderInfo' => [ 'name' => $order['order_sender_info']['name'] ?? static::$default_sender_name, @@ -106,7 +107,9 @@ class QimenWms extends BaseWms implements WmsInterface } } $postData = array_merge($postData, ['orderLines' => ['orderLine' => $orderLine]]); - $postData['deliveryOrder'] = array_merge($postData['deliveryOrder'], ['logisticsCode' => $this->chooseLogisticsCompany($order['order_address']['receive_province'], $skuTotalWeight)]); + if (!isset($order['order_express']) || !$order['order_express']) { + $postData['deliveryOrder'] = array_merge($postData['deliveryOrder'], ['logisticsCode' => $this->chooseLogisticsCompany($order['order_address']['receive_province'], $skuTotalWeight)]); + } $result = $this->xmlPost($method, $postData); return $result; diff --git a/src/XinyiWms.php b/src/XinyiWms.php index 25ac29d..89cab5b 100644 --- a/src/XinyiWms.php +++ b/src/XinyiWms.php @@ -52,6 +52,7 @@ class XinyiWms extends BaseWms implements WmsInterface 'shopNick' => $order['order_sender_info']['shop_name'] ?? self::DEFAULT_SHOP_NAME, 'sellerNick' => $order['order_sender_info']['shop_name'] ?? self::DEFAULT_SELLER_NICK, 'remark' => $order['remark'], + 'logisticsCode' => $order['order_express'] ? strtoupper($order['order_express']) : '', //发货人信息 'senderInfo' => [ 'name' => $order['order_sender_info']['name'] ?? self::DEFAULT_SENDER_NAME, @@ -113,7 +114,9 @@ class XinyiWms extends BaseWms implements WmsInterface } } $postData = array_merge($postData, ['orderLines' => ['orderLine' => $orderLine]]); - $postData['deliveryOrder'] = array_merge($postData['deliveryOrder'], ['logisticsCode' => $this->chooseLogisticsCompany($order['order_address']['receive_province'], $skuTotalWeight)]); + if (!isset($order['order_express']) || !$order['order_express']) { + $postData['deliveryOrder'] = array_merge($postData['deliveryOrder'], ['logisticsCode' => $this->chooseLogisticsCompany($order['order_address']['receive_province'], $skuTotalWeight)]); + } $result = $this->xmlPost($method, $postData); return $result;