...
|
...
|
@@ -70,10 +70,15 @@ class SearchController extends AbstractAction |
|
|
'color' => FILTER_VALIDATE_INT,
|
|
|
'size' => FILTER_VALIDATE_INT,
|
|
|
'price' => FILTER_VALIDATE_INT,
|
|
|
'discount' => FILTER_VALIDATE_INT,
|
|
|
'discount' => FILTER_DEFAULT,
|
|
|
'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;
|
...
|
...
|
@@ -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_INT,
|
|
|
'sort' => FILTER_DEFAULT,
|
|
|
'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);
|
...
|
...
|
|