|
|
@@ -172,10 +172,13 @@ class ProductController extends BaseController
|
|
|
$num = floatval($num);
|
|
|
$num = (int)$num;
|
|
|
$type = $get['type'] ?? 0;
|
|
|
+ $priceOption = $get['priceOption'] ?? 0;
|
|
|
$info = ProductClass::getById($id, true);
|
|
|
if (empty($info)) {
|
|
|
util::fail('没有找到花材');
|
|
|
}
|
|
|
+ $price = $info->skPrice ?? 0;
|
|
|
+ $price = floatval($price);
|
|
|
$name = $info->name ?? '';
|
|
|
$ptItemId = $info->itemId ?? 0;
|
|
|
$mainId = $info->mainId ?? 0;
|
|
|
@@ -190,7 +193,7 @@ class ProductController extends BaseController
|
|
|
$unit = '若干' . $info->smallUnit . '/' . $info->bigUnit;
|
|
|
}
|
|
|
$p->times = $num;
|
|
|
- if (stringUtil::getWordNum($name) > 8) {
|
|
|
+ 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>';
|
|
|
@@ -206,7 +209,11 @@ class ProductController 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="1" h="1" 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') {
|
|
|
@@ -216,21 +223,18 @@ class ProductController extends BaseController
|
|
|
}
|
|
|
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 {
|
|
|
+ } elseif ($this->main == 4556) {
|
|
|
//打价格,显示零售价,并且不带元,杭州斗南鲜花不要带元
|
|
|
- $price = $info->skPrice ?? 0;
|
|
|
- $price = floatval($price);
|
|
|
$content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '</TEXT>';
|
|
|
+ } else {
|
|
|
+ $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '元</TEXT>';
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
$p->printLabelMsg($content);
|
|
|
util::complete();
|
|
|
}
|