Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
d31dc8a8e3920c1895fa38a65456ca4223501852
1 parent
7bcc4191
日志处理优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
library/WebPlugin/HelperSearch.php
library/WebPlugin/HelperSearch.php
View file @
d31dc8a
...
...
@@ -109,7 +109,7 @@ class HelperSearch
/**
* 将接口返回的数据($data)组合成模板需要的格式
*
*
* @param array $data array(
* 'product' => array (接口得到的商品数据)
* 'sort' => array (接口返回的分类数据)
...
...
@@ -131,11 +131,11 @@ class HelperSearch
self
::
$options
=
$options
;
$result
=
array
();
self
::
$filter
=
isset
(
$data
[
'product'
][
'filter'
])
?
$data
[
'product'
][
'filter'
]
:
array
();
//当前页
$result
[
'page'
]
=
isset
(
$data
[
'product'
][
'page'
])
?
$data
[
'product'
][
'page'
]
:
''
;
self
::
$page
=
$result
[
'page'
];
//产品列表
$result
[
'goods'
]
=
isset
(
$data
[
'product'
][
'product_list'
])
?
self
::
getProductList
(
$data
[
'product'
][
'product_list'
],
$options
)
:
array
();
//总页数
...
...
@@ -184,7 +184,7 @@ class HelperSearch
if
(
empty
(
$shopSort
))
{
continue
;
}
$result
[
'shopEntry'
][]
=
$shopSort
;
$result
[
'shopEntry'
][]
=
$shopSort
;
}
}
//分页
...
...
@@ -319,7 +319,7 @@ class HelperSearch
$isNew
=
false
;
$isSale
=
false
;
}
if
(
isset
(
$options
[
'isNew'
])
&&
$options
[
'isNew'
])
{
$isNew
=
true
;
}
...
...
@@ -1457,7 +1457,7 @@ class HelperSearch
if (self::
$total
== 0) {
return
$shopEntry
;
}
if (empty(
$shopSort
)) {
$shopSort
= array();
}
...
...
@@ -1744,14 +1744,17 @@ class HelperSearch
*/
public
static
function
pinYin
(
$zh
){
$ret
=
""
;
if
(
mb_detect_encoding
(
$zh
,
array
(
'GB2312'
,
'GBK'
,
'UTF-8'
))
!=
'UTF-8'
){
$zh
=
''
;
}
@
$s1
=
iconv
(
"UTF-8"
,
"gbk//ignore"
,
$zh
);
@
$s2
=
iconv
(
"gbk//ignore"
,
"UTF-8"
,
$s1
);
if
(
$s2
==
$zh
){
$zh
=
$s1
;}
for
(
$i
=
0
;
$i
<
strlen
(
$zh
);
$i
++
){
$s1
=
substr
(
$zh
,
$i
,
1
);
$s1
=
mb_
substr
(
$zh
,
$i
,
1
);
$p
=
ord
(
$s1
);
if
(
$p
>
160
){
$s2
=
substr
(
$zh
,
$i
++
,
2
);
$s2
=
mb_
substr
(
$zh
,
$i
++
,
2
);
$ret
.=
self
::
getfirstchar
(
$s2
);
}
else
{
$ret
.=
$s1
;
...
...
@@ -1771,6 +1774,10 @@ class HelperSearch
if
(
$fchar
>=
ord
(
"A"
)
and
$fchar
<=
ord
(
"z"
)
)
{
return
strtoupper
(
$s0
{
0
});
}
if
(
mb_detect_encoding
(
$s0
,
array
(
'GB2312'
,
'GBK'
,
'UTF-8'
))
!=
'UTF-8'
)
{
return
''
;
}
$s1
=
@
iconv
(
"UTF-8"
,
"gbk//ignore"
,
$s0
);
$s2
=
@
iconv
(
"gbk//ignore"
,
"UTF-8"
,
$s1
);
if
(
$s2
==
$s0
)
{
...
...
Please
register
or
login
to post a comment