Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
10 years ago
Commit
aea3d017a6af4125bb09080114437ff61a72adbc
1 parent
3f2aba05
modify search list msort to sort
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
framework
yohobuy/m.yohobuy.com/application/controllers/Search.php
framework
@
75bbc3b0
Subproject commit
119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit
75bbc3b075de19f239532f60c5995d06c5f814e2
...
...
yohobuy/m.yohobuy.com/application/controllers/Search.php
View file @
aea3d01
...
...
@@ -70,10 +70,15 @@ class SearchController extends AbstractAction
'color'
=>
FILTER_VALIDATE_INT
,
'size'
=>
FILTER_VALIDATE_INT
,
'price'
=>
FILTER_VALIDATE_INT
,
'discount'
=>
FILTER_
VALIDATE_IN
T
,
'discount'
=>
FILTER_
DEFAUL
T
,
'gender'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,),
false
);
$query
=
isset
(
$condition
[
'query'
])
?
strtolower
(
trim
(
$condition
[
'query'
]))
:
null
;
if
(
isset
(
$condition
[
'discount'
]))
{
$condition
[
'p_d'
]
=
rawurldecode
(
$condition
[
'discount'
]);
unset
(
$condition
[
'discount'
]);
}
// 标识用户是否有输入搜索内容
$haveQuery
=
$query
!==
null
;
...
...
@@ -116,10 +121,10 @@ class SearchController extends AbstractAction
// 跳转到品牌商品列表页
if
(
$domain
!==
null
)
{
$url
=
Helpers
::
url
(
''
,
array
(
'from'
=>
'search'
,
'query'
=>
$query
,
'gender'
=>
$condition
[
'gender'
]
),
$domain
);
'from'
=>
'search'
,
'query'
=>
$query
,
'gender'
=>
$condition
[
'gender'
]
),
$domain
);
$this
->
go
(
$url
);
}
}
...
...
@@ -206,7 +211,7 @@ class SearchController extends AbstractAction
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'query'
=>
FILTER_DEFAULT
,
'brand'
=>
FILTER_VALIDATE_INT
,
'sort'
=>
FILTER_
VALIDATE_IN
T
,
'sort'
=>
FILTER_
DEFAUL
T
,
'msort'
=>
FILTER_VALIDATE_INT
,
'misort'
=>
FILTER_VALIDATE_INT
,
'color'
=>
FILTER_VALIDATE_INT
,
...
...
@@ -216,6 +221,17 @@ class SearchController extends AbstractAction
'gender'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,),
false
);
if
(
isset
(
$condition
[
'sort'
]))
{
$condition
[
'sort'
]
=
rawurldecode
(
$condition
[
'sort'
]);
}
if
(
isset
(
$condition
[
'discount'
]))
{
$condition
[
'p_d'
]
=
rawurldecode
(
$condition
[
'discount'
]);
unset
(
$condition
[
'discount'
]);
}
if
(
isset
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
// 转换排序方式
$page
=
$this
->
get
(
'page'
,
1
);
$order
=
$this
->
get
(
'order'
,
0
);
...
...
@@ -240,12 +256,12 @@ class SearchController extends AbstractAction
$condition
[
'page'
]
=
$page
;
// 搜索品类
if
(
!
isset
(
$condition
[
'brand'
]))
{
$data
+=
Product\ListModel
::
getClassData
(
$condition
);
}
$data
+=
Product\ListModel
::
getClassData
(
$condition
);
}
// 搜索品牌
else
{
$title
=
''
;
$data
+=
Product\ListModel
::
getBrandData
(
$condition
,
$title
);
$data
+=
Product\ListModel
::
getBrandData
(
$condition
,
$title
);
}
if
(
isset
(
$data
[
'filter'
]))
{
unset
(
$data
[
'filter'
]);
...
...
Please
register
or
login
to post a comment