Commit aee73773 by 肖康
parents 869994ef 8de6803d
Showing with 34 additions and 48 deletions
......@@ -99,73 +99,59 @@ class WebController extends Controller
$tmpRelation->tmpRelation = $tmpRelation->template->template_extend;
$tmpRelation->saleOrder = $tmpRelation->saleOrder;
// dump($tmpRelation);
// dump($tmpRelation->template);
// dump($tmpRelation->template->template_extend);
// dump($tmpRelation->saleOrder);
// dump($tmpRelation->tmpRelation->html);
// dump($tmpRelation->saleOrder);
$info['templateInfo'] = $tmpRelation;
$info["ichunt2020"]["sale_order_sn"] = $tmpRelation->saleOrder->sale_order_sn;
$info["ichunt2020"]["goods_type"] = $tmpRelation->saleOrder->goods_type;
$info["ichunt2020"]["goods_brand"] = $tmpRelation->saleOrder->goods_brand;
$info["ichunt2020"]["goods_number"] = $tmpRelation->saleOrder->goods_number;
$info["ichunt2020"]["sku_code"] = $tmpRelation->saleOrder->customer_code;
$info["ichunt2020"]["customer_type"] = $tmpRelation->saleOrder->customer_type;
// dump($info["ichunt2020"]);
$info["ichunt2020"]["customer_code"] = $tmpRelation->saleOrder->customer_code;
$info["ichunt2020"]["customer_com"] = $tmpRelation->saleOrder->customer_com;
try{
$matches = [];
$a = preg_match_all('/<<<(.*?)>>>/i',$tmpRelation->tmpRelation->html,$matches);
foreach($matches[1] as $k=>$field){
$arr[$k] = isset($info["ichunt2020"][$field])?$info["ichunt2020"][$field] : '';
}
if(!empty($matches)){
$html = str_replace($matches[0],$arr,$tmpRelation->tmpRelation->html);
}else{
$html = $tmpRelation->tmpRelation->html;
}
$matches = [];
$a = preg_match_all('/<<<(.*?)>>>/i',$tmpRelation->tmpRelation->html,$matches);
// dump($matches);
foreach($matches[1] as $k=>$field){
$arr[$k] = $info["ichunt2020"][$field];
}
if(!empty($matches)){
$html = str_replace($matches[0],$arr,$tmpRelation->tmpRelation->html);
}else{
$html = $tmpRelation->tmpRelation->html;
}
$dom = HtmlDomParser::str_get_html( $html );
$dom = HtmlDomParser::str_get_html( $html );
$textareas = $dom->find('textarea');
foreach($textareas as $k=>$textarea){
$textarea->innertext = $textarea->datatypes;
}
$textareas = $dom->find('textarea');
foreach($textareas as $k=>$textarea){
$textarea->innertext = $textarea->datatypes;
}
$yiweimaits = $dom->find("div[name='yiweimait']");
foreach($yiweimaits as $k=>$yiweimait){
$yiweimaits = $dom->find("div[name='yiweimait']");
foreach($yiweimaits as $k=>$yiweimait){
// dump($yiweimait->imagesurl);
// dump($yiweimait->style);
// dump($yiweimait->datatypes);
// dump(DNS1D::getBarcodePNG($yiweimait->datatypes, "C128"));
$a = $yiweimait->style;
$b = 'data:image/png;base64,' . DNS1D::getBarcodePNG($yiweimait->datatypes, "C128");
$a = $yiweimait->style;
$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);
$yiweimait->style = $c;
$c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a);
$yiweimait->style = $c;
}
}
$erweimas = $dom->find("div[name='erweimait']");
foreach($erweimas as $k=>$erweima){
$a =$erweima->style;
$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);
$erweima->style = $c;
}
$erweimas = $dom->find("div[name='erweimait']");
foreach($erweimas as $k=>$erweima){
// dump($erweima->datatypes);
$a =$erweima->style;
$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);
// dump($c);
$erweima->style = $c;
}catch(\Exception $e){
dump($e->getMessage());
}
//exit;
// dump($dom);
// exit;
// \View::make('admin.messages', $info["ichunt2020"]);
// dump($html);exit;
......
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