Authored by Rock Zhang

修复筛选数据错误的bug

@@ -17,7 +17,7 @@ class ListProcess @@ -17,7 +17,7 @@ class ListProcess
17 */ 17 */
18 public static function getListData($data, $returnFilter = true) 18 public static function getListData($data, $returnFilter = true)
19 { 19 {
20 - $result = array('new'=>array(), 'filter'=>array()); 20 + $result = array();
21 21
22 if(isset($data['product_list'])) 22 if(isset($data['product_list']))
23 { 23 {
1 <?php 1 <?php
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 -use LibModels\Wap\Product\SearchData; 4 +// use LibModels\Wap\Product\SearchData;
5 use Plugin\DataProcess\ListProcess; 5 use Plugin\DataProcess\ListProcess;
6 use Plugin\Helpers; 6 use Plugin\Helpers;
7 7
@@ -270,32 +270,22 @@ class SearchController extends AbstractAction @@ -270,32 +270,22 @@ class SearchController extends AbstractAction
270 'gender' => FILTER_DEFAULT, 270 'gender' => FILTER_DEFAULT,
271 'p_d' => FILTER_DEFAULT,), false); 271 'p_d' => FILTER_DEFAULT,), false);
272 272
  273 + // 转义分类
273 if (isset($condition['sort'])) { 274 if (isset($condition['sort'])) {
274 $condition['sort'] = rawurldecode($condition['sort']); 275 $condition['sort'] = rawurldecode($condition['sort']);
275 } 276 }
  277 + // 转换折扣
276 if (isset($condition['discount'])) { 278 if (isset($condition['discount'])) {
277 $condition['p_d'] = rawurldecode($condition['discount']); 279 $condition['p_d'] = rawurldecode($condition['discount']);
278 unset($condition['discount']); 280 unset($condition['discount']);
279 } 281 }
  282 + // 转义性别
280 if (isset($condition['gender'])) { 283 if (isset($condition['gender'])) {
281 $condition['gender'] = rawurldecode($condition['gender']); 284 $condition['gender'] = rawurldecode($condition['gender']);
282 } 285 }
283 286
284 // 区别各种列表页面的筛选数据 287 // 区别各种列表页面的筛选数据
285 - if (isset($condition['brand'])) {  
286 - $title = '';  
287 - $listData = Product\ListModel::getBrandData($condition, $title);  
288 - } else if(isset($condition['sort'])) {  
289 - $listData = Product\ListModel::getClassData($condition);  
290 - } else {  
291 - $searchData = SearchData::searchByCondition($condition);  
292 - if (isset($searchData['data']) && isset($searchData['data']['filter'])) {  
293 - $listData['filter'] = ListProcess::getFilterData($searchData['data']['filter']);  
294 - }  
295 - }  
296 -  
297 - ($listData && isset($listData['filter'])) && $data['filter'] = $listData['filter'];  
298 - $listData = array(); 288 + $data = Product\FilterModel::getFilterData($condition);
299 } 289 }
300 290
301 if (empty($data)) { 291 if (empty($data)) {
@@ -310,7 +300,7 @@ class SearchController extends AbstractAction @@ -310,7 +300,7 @@ class SearchController extends AbstractAction
310 * 300 *
311 * @return array 模糊搜索的结果 301 * @return array 模糊搜索的结果
312 */ 302 */
313 - public function fuzzysearch() 303 + /*public function fuzzysearch()
314 { 304 {
315 if ($this->isAjax()) { 305 if ($this->isAjax()) {
316 $keyword = $this->post('keyword', ''); 306 $keyword = $this->post('keyword', '');
@@ -319,6 +309,6 @@ class SearchController extends AbstractAction @@ -319,6 +309,6 @@ class SearchController extends AbstractAction
319 309
320 $this->echoJson($result); 310 $this->echoJson($result);
321 } 311 }
322 - } 312 + }*/
323 313
324 } 314 }