|
|
@@ -453,7 +453,33 @@ class OrderClass extends BaseClass
|
|
|
|
|
|
if (isset($respond['product']) && !empty($respond['product'])) {
|
|
|
foreach ($respond['product'] as $current) {
|
|
|
- $content .= $current['name'] . " " . $current['num'] . ' ' . $current['price'] . '<BR>';
|
|
|
+ //58mm的机器,一行打印16个汉字,32个字母
|
|
|
+ $name = $current['name'] ?? '';
|
|
|
+
|
|
|
+ $currentNum = stringUtil::getWordNum($name);
|
|
|
+ if ($currentNum >= 6) {
|
|
|
+ $name = stringUtil::subStringUtf8($name, 5, '..');
|
|
|
+ }
|
|
|
+
|
|
|
+ preg_match_all("/([\x{4e00}-\x{9fa5}]){1}/u", $name, $arrCh);
|
|
|
+ //中文字数
|
|
|
+ $zwNum = count($arrCh[0]);
|
|
|
+ $totalNum = strlen($name);
|
|
|
+ $notZwNum = bcsub($totalNum, $zwNum * 3);
|
|
|
+ $holdNum = bcadd($notZwNum, $zwNum * 2);
|
|
|
+ $blankNum = bcsub(16, $holdNum);
|
|
|
+
|
|
|
+ $name = $name . str_repeat(' ', $blankNum);
|
|
|
+
|
|
|
+ $productNum = $current['num'] ?? '';
|
|
|
+ $blankNum = bcsub(9, strlen($productNum));
|
|
|
+ $productNum = $productNum . str_repeat(' ', $blankNum);
|
|
|
+
|
|
|
+ $productPrice = $current['price'] ?? '';
|
|
|
+ $blankNum = bcsub(7, strlen($productPrice));
|
|
|
+ $productPrice = $productPrice . str_repeat(' ', $blankNum);
|
|
|
+
|
|
|
+ $content .= $name . " " . $productNum . ' ' . $productPrice . '<BR>';
|
|
|
}
|
|
|
}
|
|
|
$content .= '--------------------------------<BR>';
|
|
|
@@ -519,7 +545,7 @@ class OrderClass extends BaseClass
|
|
|
$sendNum = $val['sendNum'] ?? '';
|
|
|
|
|
|
$printData = [
|
|
|
- 'address' => '--',
|
|
|
+ 'address' => '',
|
|
|
'sendCost' => $val['sendCost'] ?? '0.00',
|
|
|
'prePrice' => $val['prePrice'] ?? '0.00',
|
|
|
'discountAmount' => $val['discountAmount'] ?? '0.00',
|