shish před 4 měsíci
rodič
revize
5c9f3fcb5b
1 změnil soubory, kde provedl 5 přidání a 6 odebrání
  1. 5 6
      app-hd/controllers/PartController.php

+ 5 - 6
app-hd/controllers/PartController.php

@@ -137,12 +137,11 @@ class PartController extends BaseController
         if (empty($itemList)) {
             util::fail('没有花材需要打印');
         }
-
-        $currentShopId = $this->admin->currentGhsShopId;
-        $ext = ShopExtClass::getByCondition(['shopId' => $currentShopId], true);
-        $printSn = is_array($ext) ? ($ext['printSn'] ?? '') : ($ext->printSn ?? '');
-        $printKey = is_array($ext) ? ($ext['printKey'] ?? '') : ($ext->printKey ?? '');
-        if (!empty($printSn) || empty($printKey)) {
+        $shopId = $this->shopId;
+        $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        $printSn = $ext->printSn ?? '';
+        $printKey = $ext->printKey ?? '';
+        if (empty($printSn) || empty($printKey)) {
             util::success(['hasNoPrint' => 1]);
         }