...
|
...
|
@@ -35,13 +35,14 @@ class SearchController extends AbstractAction |
|
|
// 过滤请求参数
|
|
|
$condition = filter_input_array(INPUT_GET, array(
|
|
|
'query' => FILTER_DEFAULT,
|
|
|
'brand' => FILTER_VALIDATE_INT,
|
|
|
'brand' => FILTER_DEFAULT,
|
|
|
'sort' => FILTER_DEFAULT,
|
|
|
'msort' => FILTER_DEFAULT,
|
|
|
'misort' => FILTER_DEFAULT,
|
|
|
'color' => FILTER_VALIDATE_INT,
|
|
|
'size' => FILTER_VALIDATE_INT,
|
|
|
'price' => FILTER_VALIDATE_INT,
|
|
|
'color' => FILTER_DEFAULT,
|
|
|
'size' => FILTER_DEFAULT,
|
|
|
'style' => FILTER_DEFAULT,
|
|
|
'price' => FILTER_DEFAULT,
|
|
|
'discount' => FILTER_DEFAULT,
|
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,), false);
|
...
|
...
|
@@ -49,7 +50,11 @@ class SearchController extends AbstractAction |
|
|
$query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
|
|
|
if (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
unset($condition['discount']);
|
|
|
// unset($condition['discount']); 为了兼容js中传参的discount
|
|
|
}
|
|
|
// 为了兼容现在运营在用的p_d
|
|
|
if (isset($condition['p_d'])) {
|
|
|
$condition['discount'] = rawurldecode($condition['p_d']);
|
|
|
}
|
|
|
if (isset($condition['query'])) {
|
|
|
$condition['query'] = rawurlencode($condition['query']);
|
...
|
...
|
@@ -200,13 +205,14 @@ class SearchController extends AbstractAction |
|
|
/* 过滤请求参数 */
|
|
|
$condition = filter_input_array(INPUT_GET, array(
|
|
|
'query' => FILTER_DEFAULT,
|
|
|
'brand' => FILTER_VALIDATE_INT,
|
|
|
'brand' => FILTER_DEFAULT,
|
|
|
'sort' => FILTER_DEFAULT,
|
|
|
'msort' => FILTER_DEFAULT,
|
|
|
'misort' => FILTER_DEFAULT,
|
|
|
'color' => FILTER_VALIDATE_INT,
|
|
|
'size' => FILTER_VALIDATE_INT,
|
|
|
'price' => FILTER_VALIDATE_INT,
|
|
|
'color' => FILTER_DEFAULT,
|
|
|
'size' => FILTER_DEFAULT,
|
|
|
'style' => FILTER_DEFAULT,
|
|
|
'price' => FILTER_DEFAULT,
|
|
|
'discount' => FILTER_DEFAULT,
|
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,
|
...
|
...
|
@@ -215,12 +221,22 @@ class SearchController extends AbstractAction |
|
|
if (isset($condition['sort'])) {
|
|
|
$condition['sort'] = rawurldecode($condition['sort']);
|
|
|
}
|
|
|
// 转义分类
|
|
|
if (isset($condition['msort'])) {
|
|
|
$condition['msort'] = rawurldecode($condition['msort']);
|
|
|
}
|
|
|
// 转义分类
|
|
|
if (isset($condition['misort'])) {
|
|
|
$condition['misort'] = rawurldecode($condition['misort']);
|
|
|
}
|
|
|
// 转义价格
|
|
|
if (isset($condition['price'])) {
|
|
|
$condition['price'] = rawurldecode($condition['price']);
|
|
|
}
|
|
|
// 转义风格
|
|
|
if (isset($condition['style'])) {
|
|
|
$condition['style'] = rawurldecode($condition['style']);
|
|
|
}
|
|
|
// 转换折扣
|
|
|
if (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
...
|
...
|
@@ -259,7 +275,6 @@ class SearchController extends AbstractAction |
|
|
// $data = Product\ListModel::getClassData($condition);
|
|
|
|
|
|
$data = Product\SearchModel::getSearchData($condition);
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
if (empty($data['new'])) {
|
...
|
...
|
@@ -281,13 +296,14 @@ class SearchController extends AbstractAction |
|
|
// 过滤请求参数
|
|
|
$condition = filter_input_array(INPUT_GET, array(
|
|
|
'query' => FILTER_DEFAULT,
|
|
|
'brand' => FILTER_VALIDATE_INT,
|
|
|
'brand' => FILTER_DEFAULT,
|
|
|
'sort' => FILTER_DEFAULT,
|
|
|
'msort' => FILTER_VALIDATE_INT,
|
|
|
'misort' => FILTER_VALIDATE_INT,
|
|
|
'color' => FILTER_VALIDATE_INT,
|
|
|
'size' => FILTER_VALIDATE_INT,
|
|
|
'price' => FILTER_VALIDATE_INT,
|
|
|
'msort' => FILTER_DEFAULT,
|
|
|
'misort' => FILTER_DEFAULT,
|
|
|
'color' => FILTER_DEFAULT,
|
|
|
'size' => FILTER_DEFAULT,
|
|
|
'style' => FILTER_DEFAULT,
|
|
|
'price' => FILTER_DEFAULT,
|
|
|
'discount' => FILTER_DEFAULT,
|
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,), false);
|
...
|
...
|
@@ -305,6 +321,14 @@ class SearchController extends AbstractAction |
|
|
if (isset($condition['gender'])) {
|
|
|
$condition['gender'] = rawurldecode($condition['gender']);
|
|
|
}
|
|
|
// 转义价格
|
|
|
if (isset($condition['price'])) {
|
|
|
$condition['price'] = rawurldecode($condition['price']);
|
|
|
}
|
|
|
// 转义风格
|
|
|
if (isset($condition['style'])) {
|
|
|
$condition['style'] = rawurldecode($condition['style']);
|
|
|
}
|
|
|
|
|
|
// 区别各种列表页面的筛选数据
|
|
|
$data = Product\SearchModel::getFilterData($condition);
|
...
|
...
|
|