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