Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
note-library
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1705a0e7
authored
May 13, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
49e6c273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
48 deletions
app/Http/Controllers/WebController.php
app/Http/Controllers/WebController.php
View file @
1705a0e7
...
...
@@ -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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment