shish 1 год назад
Родитель
Сommit
bb860a48ee
1 измененных файлов с 23 добавлено и 15 удалено
  1. 23 15
      app-ghs/controllers/ProductController.php

+ 23 - 15
app-ghs/controllers/ProductController.php

@@ -176,27 +176,35 @@ class ProductController extends BaseController
         } else {
             $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
         }
-        //杭州斗南批发店
-        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>';
+
+        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>';
+            } elseif ($mainId == 16948) {
+                $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="1" h="1" r="0">' . $unit . '</TEXT>';
+            }
         } else {
-            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>';
-                } elseif ($mainId == 16948) {
-                    $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="1" h="1" r="0">' . $unit . '</TEXT>';
-                }
+            if (getenv('YII_ENV') == 'production') {
+                $printPrice = [4556];
+            } else {
+                $printPrice = [644];
+            }
+            if (in_array($this->mainId, $printPrice)) {
+                //打价格
+                $price = $info->skPrice ?? 0;
+                $price = floatval($price);
+                $content .= '<TEXT x="35" y="150" font="14" w="1" h="1" r="0">' . $price . '元</TEXT>';
             } else {
                 //打价码
                 $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>';
             }
+            $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
         }
+
         $p->printLabelMsg($content);
         util::complete();
     }