shish 3 anni fa
parent
commit
38ee0de37a

+ 1 - 3
app-ghs/controllers/ProductController.php

@@ -60,13 +60,11 @@ class ProductController extends BaseController
 
         $unit = $info->ratio . $info->smallUnit . '/' . $info->bigUnit;
 
-        $url = Yii::$app->params['mallHost'] . "/item/show-info?id=" . $id;
-
         $p->times = $num;
         $content = '<TEXT x="360" y="30" font="12" w="2" h="2" r="90">' . $name . '</TEXT>';
         $content .= '<BC128 x="260" y="30" h="80" s="1" r="90" n="5" w="12">' . $ptItemId . '</BC128>';
         $content .= '<TEXT x="60" y="30" font="12" w="2" h="2" r="90">' . $unit . '</TEXT>';
-        $content .= '<QR x="150"  y="390"  e="L"  w="5">' . $url . '</QR>';
+        $content .= '<QR x="150"  y="390"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $id . '</QR>';
         $content .= '<TEXT x="100" y="400" font="12" w="1" h="1" r="90">扫码看价格</TEXT>';
         $p->printLabelMsg($content);
         util::complete();

+ 10 - 0
app-ghs/controllers/PurchaseOrderController.php

@@ -39,6 +39,7 @@ class PurchaseOrderController extends BaseController
                 util::fail('没有花材数量');
             }
             $ptItemId = $item->itemId ?? '';
+            $productId = $item->productId ?? 0;
             $p->times = $num;
 
             $smallUnit = $item->smallUnit ?? '';
@@ -52,6 +53,10 @@ class PurchaseOrderController extends BaseController
                 $content .= '<TEXT x="415" y="20" font="12" w="2" h="2" r="90">.</TEXT>';
             }
             $content .= '<TEXT x="60" y="30" font="12" w="2" h="2" r="90">' . $unit . '</TEXT>';
+
+            $content .= '<QR x="150"  y="390"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $productId . '</QR>';
+            $content .= '<TEXT x="100" y="400" font="12" w="1" h="1" r="90">扫码看价格</TEXT>';
+
             $p->printLabelMsg($content);
         }
         util::complete();
@@ -84,10 +89,15 @@ class PurchaseOrderController extends BaseController
         $unit = $smallUnit . '/' . $bigUnit;
 
         $ptItemId = $item->itemId ?? '';
+        $productId = $item->productId ?? 0;
         $p->times = $num;
         $content = '<TEXT x="360" y="30" font="12" w="2" h="2" r="90">' . $name . '</TEXT>';
         $content .= '<BC128 x="260" y="30" h="80" s="1" r="90" n="5" w="12">' . $ptItemId . '</BC128>';
         $content .= '<TEXT x="60" y="30" font="12" w="2" h="2" r="90">' . $unit . '</TEXT>';
+
+        $content .= '<QR x="150"  y="390"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $productId . '</QR>';
+        $content .= '<TEXT x="100" y="400" font="12" w="1" h="1" r="90">扫码看价格</TEXT>';
+
         $p->printLabelMsg($content);
         util::complete();
     }