|
|
@@ -123,7 +123,8 @@ class OrderClass extends BaseClass
|
|
|
$price = $respond['price'] ?? 0;
|
|
|
$currentPrice = bcadd($price, $sendCost, 2);
|
|
|
$data['prePrice'] = $currentPrice;
|
|
|
-
|
|
|
+ //默认生成订单时需要打单
|
|
|
+ $data['needPrint'] = $data['needPrint'] ?? dict::getDict('needPrint', 'need');
|
|
|
if (isset($data['modifyPrice'])) {
|
|
|
//商家打折,修改金额
|
|
|
$modifyPrice = $data['modifyPrice'] ?? 0;
|
|
|
@@ -446,31 +447,18 @@ class OrderClass extends BaseClass
|
|
|
foreach ($respond['product'] as $current) {
|
|
|
//58mm的机器,一行打印16个汉字,32个字母
|
|
|
$name = $current['name'] ?? '';
|
|
|
- $currentNum = stringUtil::getWordNum($name);
|
|
|
- if ($currentNum >= 5) {
|
|
|
- $name = stringUtil::subStringUtf8($name, 4);
|
|
|
- }
|
|
|
-
|
|
|
- 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(10, $holdNum);
|
|
|
- if($blankNum > 0){
|
|
|
- $name = $name . str_repeat(' ', $blankNum);
|
|
|
- }
|
|
|
+ $content .= $name . '<BR>';
|
|
|
+ $name = str_repeat(' ', 10);
|
|
|
|
|
|
$productNum = $current['num'] ?? '';
|
|
|
$blankNum = bcsub(12, strlen($productNum));
|
|
|
- if($blankNum > 0){
|
|
|
+ if ($blankNum > 0) {
|
|
|
$productNum = $productNum . str_repeat(' ', $blankNum);
|
|
|
}
|
|
|
|
|
|
$productPrice = $current['price'] ?? '';
|
|
|
$blankNum = bcsub(7, strlen($productPrice));
|
|
|
- if($blankNum>0){
|
|
|
+ if ($blankNum > 0) {
|
|
|
$productPrice = $productPrice . str_repeat(' ', $blankNum);
|
|
|
}
|
|
|
$content .= $name . " " . $productNum . ' ' . $productPrice . '<BR>';
|
|
|
@@ -540,7 +528,7 @@ class OrderClass extends BaseClass
|
|
|
$bigTotalPrice = bcmul($bigUnitPrice, $bigNum, 2);
|
|
|
$printProduct[] = [
|
|
|
'name' => $itemVal['name'] ?? '',
|
|
|
- 'num' => $bigNum . '扎/' . $bigUnitPrice,
|
|
|
+ 'num' => $bigNum . '扎*' . $bigUnitPrice,
|
|
|
'price' => $bigTotalPrice
|
|
|
];
|
|
|
}
|
|
|
@@ -548,7 +536,7 @@ class OrderClass extends BaseClass
|
|
|
$smallTotalPrice = bcmul($smallUnitPrice, $smallNum, 2);
|
|
|
$printProduct[] = [
|
|
|
'name' => $itemVal['name'] ?? '',
|
|
|
- 'num' => $smallNum . '支/' . $smallUnitPrice,
|
|
|
+ 'num' => $smallNum . '支*' . $smallUnitPrice,
|
|
|
'price' => $smallTotalPrice
|
|
|
];
|
|
|
}
|