Authored by Rock Zhang

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

@@ -94,8 +94,7 @@ class SearchController extends AbstractAction @@ -94,8 +94,7 @@ class SearchController extends AbstractAction
94 if ($domain !== null) { 94 if ($domain !== null) {
95 $url = Helpers::url('', array( 95 $url = Helpers::url('', array(
96 'from' => 'search', 96 'from' => 'search',
97 - 'query' => $query,  
98 - 'gender' => $condition['gender'] 97 + 'query' => $query
99 ), $domain); 98 ), $domain);
100 $this->go($url); 99 $this->go($url);
101 } 100 }
@@ -287,11 +286,20 @@ class SearchController extends AbstractAction @@ -287,11 +286,20 @@ class SearchController extends AbstractAction
287 $condition['gender'] = rawurldecode($condition['gender']); 286 $condition['gender'] = rawurldecode($condition['gender']);
288 } 287 }
289 288
290 - $listData = SearchData::searchByCondition($condition);  
291 - // 处理返回的数据  
292 - if (isset($listData['data']) && isset($listData['data']['filter'])) {  
293 - $data['filter'] = ListProcess::getFilterData($listData['data']['filter']); 289 + // 区别各种列表页面的筛选数据
  290 + if (isset($condition['brand'])) {
  291 + $title = '';
  292 + $listData = Product\ListModel::getBrandData($condition, $title);
  293 + } else if(isset($condition['sort'])) {
  294 + $listData = Product\ListModel::getClassData($condition);
  295 + } else {
  296 + $searchData = SearchData::searchByCondition($condition);
  297 + if (isset($searchData['data']) && isset($searchData['data']['filter'])) {
  298 + $listData['filter'] = ListProcess::getFilterData($searchData['data']['filter']);
294 } 299 }
  300 + }
  301 +
  302 + ($listData && isset($listData['filter'])) && $data['filter'] = $listData['filter'];
295 $listData = array(); 303 $listData = array();
296 } 304 }
297 305
@@ -117,6 +117,8 @@ class IndexController extends AbstractAction @@ -117,6 +117,8 @@ class IndexController extends AbstractAction
117 117
118 if (isset($condition['gender'])) { 118 if (isset($condition['gender'])) {
119 $condition['gender'] = rawurldecode($condition['gender']); 119 $condition['gender'] = rawurldecode($condition['gender']);
  120 + } else {
  121 + $condition['gender'] = Helpers::getGenderByCookie();
120 } 122 }
121 123
122 $data = array(); 124 $data = array();