Authored by Rock Zhang

添加品牌商品列表页会自动添加gender参数,添加列表筛选数据会根据品牌、品类、一般搜索返回

... ... @@ -94,8 +94,7 @@ class SearchController extends AbstractAction
if ($domain !== null) {
$url = Helpers::url('', array(
'from' => 'search',
'query' => $query,
'gender' => $condition['gender']
'query' => $query
), $domain);
$this->go($url);
}
... ... @@ -287,11 +286,20 @@ class SearchController extends AbstractAction
$condition['gender'] = rawurldecode($condition['gender']);
}
$listData = SearchData::searchByCondition($condition);
// 处理返回的数据
if (isset($listData['data']) && isset($listData['data']['filter'])) {
$data['filter'] = ListProcess::getFilterData($listData['data']['filter']);
// 区别各种列表页面的筛选数据
if (isset($condition['brand'])) {
$title = '';
$listData = Product\ListModel::getBrandData($condition, $title);
} else if(isset($condition['sort'])) {
$listData = Product\ListModel::getClassData($condition);
} else {
$searchData = SearchData::searchByCondition($condition);
if (isset($searchData['data']) && isset($searchData['data']['filter'])) {
$listData['filter'] = ListProcess::getFilterData($searchData['data']['filter']);
}
}
($listData && isset($listData['filter'])) && $data['filter'] = $listData['filter'];
$listData = array();
}
... ...
... ... @@ -117,6 +117,8 @@ class IndexController extends AbstractAction
if (isset($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
} else {
$condition['gender'] = Helpers::getGenderByCookie();
}
$data = array();
... ...