shish 7 ヶ月 前
コミット
b2101b15d3

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

@@ -222,7 +222,7 @@ class ProductController extends BaseController
                 $doublePrice = [];
             }
             if (in_array($this->mainId, $doublePrice)) {
-                //打价格,显示正价和会员价
+                //惠雅鲜花,打价格,显示正价和会员价,多处同步修改,关键词 hy_print_label_price ssh 20260101
                 $hyPrice = $info->price ?? 0;
                 $hyPrice = floatval($hyPrice);
                 $content .= '<TEXT x="35" y="90" font="12" w="2" h="2" r="0">----------</TEXT>';

+ 24 - 13
app-ghs/controllers/PurchaseOrderController.php

@@ -179,6 +179,7 @@ class PurchaseOrderController extends BaseController
         $get = Yii::$app->request->get();
         $orderSn = $get['orderSn'] ?? 0;
         $type = $get['type'] ?? 0;
+        $priceOption = $get['priceOption'] ?? 0;
         $itemList = PurchaseOrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*', null, true);
         if (empty($itemList)) {
             util::fail('没有商品');
@@ -213,14 +214,16 @@ class PurchaseOrderController extends BaseController
             $p->times = $num;
 
             $smallUnit = $item->smallUnit ?? '';
-            $bigUnit = $item->bigUnit ?? '';
             $ratio = $item->ratio ?? 0;
-            $unit = $ratio . $smallUnit . '/' . $bigUnit;
+            $unit = $ratio . $smallUnit . '装';
             if (isset($item->ratioType) && $item->ratioType == 1) {
-                $unit = '若干' . $smallUnit . '/' . $bigUnit;
+                $unit = '若干' . $smallUnit . '装';
             }
 
-            if (stringUtil::getWordNum($name) > 8) {
+            $price = $infoList[$productId] && $infoList[$productId]['skPrice'] ? $infoList[$productId]['skPrice'] : 0;
+            $price = floatval($price);
+
+            if (stringUtil::getWordNum($name) > 14) {
                 $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
             } else {
                 $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
@@ -237,22 +240,30 @@ class PurchaseOrderController extends BaseController
                 } elseif ($mainId == 72057) {
                     $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>';
+                    if($priceOption == 0){
+                        $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 . ' ' . $price . '元</TEXT>';
+                    }
                 }
             } else {
                 if (getenv('YII_ENV') == 'production') {
-                    $printPrice = [4556];
+                    $doublePrice = [52, 1459];
                 } else {
-                    $printPrice = [644];
+                    $doublePrice = [];
                 }
-                if (in_array($this->mainId, $printPrice)) {
-                    //打价格
-                    $price = $infoList[$productId] && $infoList[$productId]['skPrice'] ? $infoList[$productId]['skPrice'] : 0;
-                    $price = floatval($price);
+                if (in_array($this->mainId, $doublePrice)) {
+                    //惠雅鲜花,打价格,显示正价和会员价,多处同步修改,关键词 hy_print_label_price ssh 20260101
+                    $hyPrice = $infoList[$productId] && $infoList[$productId]['price'] ? $infoList[$productId]['price'] : 0;
+                    $hyPrice = floatval($hyPrice);
+                    $content .= '<TEXT x="35" y="90" font="12" w="2" h="2" r="0">----------</TEXT>';
+                    $content .= '<TEXT x="35" y="150" font="12" w="2" h="2" r="0">正价 ' . $price . '元</TEXT>';
+                    $content .= '<TEXT x="35" y="230" font="12" w="2" h="2" r="0">会员价 ' . $hyPrice . '元</TEXT>';
+                }elseif ($this->mainId == 4556) {
+                    //打价格,显示零售价,并且不带元,杭州斗南鲜花不要带元
                     $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '</TEXT>';
                 } else {
-                    $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $productId . '</QR>';
-                    $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
+                    $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '元</TEXT>';
                 }
             }
             $p->printLabelMsg($content);