From 5ec16680577188b4fc93d68a47cc93988e2f4cd4 Mon Sep 17 00:00:00 2001 From: ZweiCD <416931358@qq.com> Date: Thu, 27 Aug 2020 16:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=BF=AB=E9=80=92code?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=AE=A2=E5=8D=95bc=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WmsStrategy.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/WmsStrategy.php b/src/WmsStrategy.php index 184f60d..dfe21a8 100644 --- a/src/WmsStrategy.php +++ b/src/WmsStrategy.php @@ -156,4 +156,23 @@ class WmsStrategy return 'toC'; } } + + /** + * 根据物流快递判断订单bc类型 + * @param $expressCode + * @return string + */ + static public function getOrderTypeByExpressCode($expressCode) + { + $expressChooseConf = require(dirname(dirname(__FILE__)) . '/config/express_choose.php'); + $logisticsToC = collect($expressChooseConf['logistics']['toC'])->pluck('code')->toArray(); + if (in_array($expressCode, $logisticsToC)) { + return 'toC'; + } + $logisticsToB = collect($expressChooseConf['logistics']['toB'])->pluck('code')->toArray(); + if (in_array($expressCode, $logisticsToB)) { + return 'toB'; + } + return ''; + } }