Explorar o código

价格码问题

shish hai 9 meses
pai
achega
5e5e5893d1
Modificáronse 1 ficheiros con 15 adicións e 21 borrados
  1. 15 21
      app-ghs/controllers/ProductController.php

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

@@ -189,30 +189,24 @@ class ProductController extends BaseController
             }
         } else {
             if (getenv('YII_ENV') == 'production') {
-                $printPrice = [4556, 52, 1459];
+                $doublePrice = [52, 1459];
             } else {
-                $printPrice = [644];
+                $doublePrice = [];
             }
-            if (in_array($this->mainId, $printPrice)) {
-                if (in_array($this->mainId, [52, 1459, 644])) {
-                    //打价格
-                    $price = $info->skPrice ?? 0;
-                    $price = floatval($price);
-                    $hyPrice = $info->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>';
-                } else {
-                    //打价格
-                    $price = $info->skPrice ?? 0;
-                    $price = floatval($price);
-                    $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '</TEXT>';
-                }
+            if (in_array($this->mainId, $doublePrice)) {
+                //打价格,显示正价和会员价
+                $price = $info->skPrice ?? 0;
+                $price = floatval($price);
+                $hyPrice = $info->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>';
             } 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>';
+                //打价格,显示零售价,并且不带元,杭州斗南鲜花不要带元
+                $price = $info->skPrice ?? 0;
+                $price = floatval($price);
+                $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '</TEXT>';
             }
         }