shish 2 лет назад
Родитель
Сommit
7083b5a2aa
1 измененных файлов с 45 добавлено и 14 удалено
  1. 45 14
      biz-ghs/order/classes/OrderClass.php

+ 45 - 14
biz-ghs/order/classes/OrderClass.php

@@ -1068,6 +1068,9 @@ class OrderClass extends BaseClass
 
         $shopId = $orderInfo->shopId ?? 0;
         $shop = ShopClass::getById($shopId, true);
+        if (empty($shop)) {
+            util::fail('打印失败,没有找到门店');
+        }
         $sjId = $shop->sjId ?? 0;
         $fontSizeType = $shop->fontSize ?? 0;
         $telephone = $shop->telephone ?? '';
@@ -1107,23 +1110,51 @@ class OrderClass extends BaseClass
         if (isset($orderInfo->presell) && $orderInfo->presell == 1) {
             $content .= '<B>预售单</B><BR>';
         }
-        if (isset($orderInfo->sendType)) {
-            $sendName = '送货上门';
-            if ($orderInfo->sendType == 1) {
-                $sendName = '到店自取';
-            }
-            if ($orderInfo->sendType == 2) {
-                $sendName = '代叫配送';
-            }
-            if ($orderInfo->sendType == 3) {
-                $wlName = $orderInfo['wlName'] ?? '未填物流';
-                $sendName = $wlName;
+
+        if (isset($shop->pfLevel) && $shop->pfLevel == 1) {
+            if (isset($orderInfo->transType)) {
+                $sendName = '同城配送';
+                if ($orderInfo->transType == 0) {
+                    $sendName = '德邦物流';
+                }
+                if ($orderInfo->transType == 1) {
+                    $sendName = '顺丰物流';
+                }
+                if ($orderInfo->transType == 2) {
+                    $sendName = '冷链物流';
+                }
+                if ($orderInfo->transType == 3) {
+                    $sendName = '航空物流';
+                }
+                if ($orderInfo->transType == 4) {
+                    $sendName = '同城配送';
+                }
+                if ($orderInfo->transType == 5) {
+                    $sendName = '到店自取';
+                }
+                $content .= '<BR><B>' . $sendName . '</B><BR>';
             }
-            if ($orderInfo->sendType == 4) {
-                $sendName = '发快递';
+        } else {
+            if (isset($orderInfo->sendType)) {
+                $sendName = '送货上门';
+                if ($orderInfo->sendType == 1) {
+                    $sendName = '到店自取';
+                }
+                if ($orderInfo->sendType == 2) {
+                    $sendName = '代叫配送';
+                }
+                if ($orderInfo->sendType == 3) {
+                    $wlName = $orderInfo['wlName'] ?? '未填物流';
+                    $sendName = $wlName;
+                }
+                if ($orderInfo->sendType == 4) {
+                    $sendName = '发快递';
+                }
+                $content .= '<BR><B>' . $sendName . '</B><BR>';
             }
-            $content .= '<BR><B>' . $sendName . '</B><BR>';
+
         }
+
         if (!empty($remarkString)) {
             $content .= '<BR>';
             $content .= '备注:<BR>';