shish 3 rokov pred
rodič
commit
068c0bb779
1 zmenil súbory, kde vykonal 13 pridanie a 5 odobranie
  1. 13 5
      app-ghs/controllers/ProductController.php

+ 13 - 5
app-ghs/controllers/ProductController.php

@@ -95,6 +95,7 @@ class ProductController extends BaseController
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
         $num = $get['num'] ?? 1;
+        $type = $get['type'] ?? 0;
         $info = ProductClass::getById($id, true);
         if (empty($info)) {
             util::fail('没有找到花材');
@@ -116,15 +117,22 @@ class ProductController extends BaseController
             $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
         }
         //杭州斗南批发店
-        if ($this->shopId == 4608) {
+        if (isset($get['type']) == false && $this->shopId == 4608) {
             $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $id . '</QR>';
             $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
         } else {
-            $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
-            if (in_array($mainId, [52, 1459])) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
+            if ($type == 0) {
+                //打标签
+                $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
+                if (in_array($mainId, [52, 1459])) {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
+                } else {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
+                }
             } else {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
+                //打价码
+                $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $id . '</QR>';
+                $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
             }
         }
         $p->printLabelMsg($content);