Commit 1cbdc065 by 孙龙

打印报错 二维码 一维码么数据报错问题

parent ff9acd37
Showing with 6 additions and 0 deletions
...@@ -142,6 +142,9 @@ class LabelService { ...@@ -142,6 +142,9 @@ class LabelService {
foreach($yiweimaits as $k=>$yiweimait){ foreach($yiweimaits as $k=>$yiweimait){
try{ try{
$a = $yiweimait->style; $a = $yiweimait->style;
if(empty($yiweimait->datatypes)){
$yiweimait->datatypes = "暂无数据";
}
$b = 'data:image/png;base64,' . DNS1D::getBarcodePNG($yiweimait->datatypes, "C128"); $b = 'data:image/png;base64,' . DNS1D::getBarcodePNG($yiweimait->datatypes, "C128");
$c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a); $c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a);
$yiweimait->style = $c; $yiweimait->style = $c;
...@@ -154,6 +157,9 @@ class LabelService { ...@@ -154,6 +157,9 @@ class LabelService {
foreach($erweimas as $k=>$erweima){ foreach($erweimas as $k=>$erweima){
try{ try{
$a =$erweima->style; $a =$erweima->style;
if(empty($erweima->datatypes)){
$erweima->datatypes = "暂无数据";
}
$b = 'data:image/png;base64,' . DNS2D::getBarcodePNG($erweima->datatypes, "QRCODE"); $b = 'data:image/png;base64,' . DNS2D::getBarcodePNG($erweima->datatypes, "QRCODE");
$c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a); $c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a);
$erweima->style = $c; $erweima->style = $c;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment