Authored by 周少峰

添加分页,helpsearch代码优化

1 <?php 1 <?php
2 2
3 namespace Plugin; 3 namespace Plugin;
4 -use Plugin\Images; 4 +use Plugin\Paging;
5 /** 5 /**
6 * 搜索辅助类 6 * 搜索辅助类
7 */ 7 */
@@ -10,11 +10,10 @@ class HelperSearch @@ -10,11 +10,10 @@ class HelperSearch
10 /** 10 /**
11 * 请求时用的所有参数 11 * 请求时用的所有参数
12 */ 12 */
13 - private static $params = array(); 13 + public static $params = array();
14 14
15 - //当前页面  
16 - private static $current_url = '';  
17 - private static $page = 1; 15 + //当前页
  16 + public static $page = 1;
18 17
19 /** 18 /**
20 * 选中的条件 19 * 选中的条件
@@ -25,132 +24,101 @@ class HelperSearch @@ -25,132 +24,101 @@ class HelperSearch
25 * list分类面包屑 24 * list分类面包屑
26 * @var array 25 * @var array
27 */ 26 */
28 - public static $listnav = array(  
29 - array( 27 + public static $listnav = array();
  28 +
  29 +
  30 + //设置导航
  31 + private static function setListNav($option = array())
  32 + {
  33 + $cookieChannel = isset($_COOKIE['_Channel']) ? $_COOKIE['_Channel'] : 'boys';
  34 + if (isset($option['brandName']) && !empty($option['brandName'])) {
  35 + $initNav = $option['brandName'];
  36 + }else{
  37 + $initNav = '列表';
  38 + }
  39 + self::$listnav[0] = array(
30 'href' => '', 40 'href' => '',
31 - 'name' => '首页'  
32 - ),  
33 - array( 41 + 'name' => $cookieChannel
  42 + );
  43 + self::$listnav[1] = array(
34 'href' => '', 44 'href' => '',
35 - 'name' => '列表'  
36 - ) 45 + 'name' => $initNav
37 ); 46 );
38 - 47 + }
39 /** 48 /**
40 * 组织搜索模板数据 49 * 组织搜索模板数据
41 * @param array $data 50 * @param array $data
42 * @param array $options 51 * @param array $options
43 * @return array 52 * @return array
44 */ 53 */
45 - public static function getList($data = array() , $options = array()) {  
46 - if (empty($data)) {  
47 - return array();  
48 - } 54 + public static function getList($data = array() , $options = array())
  55 + {
  56 + $result = array();
49 self::$params = $_GET; 57 self::$params = $_GET;
50 unset(self::$params['/']); 58 unset(self::$params['/']);
51 unset(self::$params['page']); 59 unset(self::$params['page']);
52 unset(self::$params['/sale']); 60 unset(self::$params['/sale']);
53 unset(self::$params['sale']); 61 unset(self::$params['sale']);
54 - $result = array();  
55 - if (!isset($data['data']) || !isset($data['data']['product_list']) || !is_array($data['data']['product_list'])) {  
56 - return array();  
57 - }  
58 - $result['product_list'] = self::getProductList($data['data']['product_list'], $options['imgSize'], $options['minImgSize'], $options['gender']); 62 + $filter = $data['data']['filter'];
  63 + //产品列表
  64 + $result['goods'] = self::getProductList($data['data']['product_list'], $options['imgSize']);
  65 + //总页数
59 $result['page_total'] = $data['data']['page_total']; 66 $result['page_total'] = $data['data']['page_total'];
60 - $result['total'] = $data['data']['total']; 67 + //当前页
61 $result['page'] = $data['data']['page']; 68 $result['page'] = $data['data']['page'];
62 - //设置当前页  
63 self::$page = $result['page']; 69 self::$page = $result['page'];
64 - //搜索条件  
65 - if (isset($data['data']['filter']) && !empty($data['data']['filter'])) {  
66 - $filter = $data['data']['filter'];  
67 - $result['filter']['left_sort'] = isset($filter['minsort']) ? self::minsort($filter['minsort']) : array();  
68 - $result['filter']['group_sort'] = isset($filter['group_sort']) ? self::groupSort($filter['group_sort'], $options) : array();  
69 - $result['filter']['size'] = self::size($filter);  
70 - $result['filter']['color'] = self::color($filter);  
71 - $result['filter']['price'] = self::price($filter);  
72 - $result['filter']['brand'] = self::brand($filter);  
73 - $result['filter']['parameters'] = self::standard($filter);  
74 - $result['filter']['rowNum4'] = self::rowNum();  
75 - $result['filter']['rowNum6'] = self::rowNum(6);  
76 - $result['filter']['viewNum'] = self::viewNum();  
77 - $result['filter']['priceSubmit'] = self::priceSubmit();  
78 - $result['filter']['gender'] = self::gender($filter);  
79 - $result['filter']['selected'] = self::getSelected();  
80 - $result['filter']['checks'] = array(self::isnew(),self::specialoffer(),self::limited());  
81 - $result['filter']['sortType'] = array( self::orderDefault(),self::orderTime(),self::orderPrice(),self::orderDiscount());  
82 - $result['filter']['clear'] =self::current();  
83 - $result['filter']['next'] = self::next($data['data']['page_total'],$data['data']['filter']);  
84 - $result['filter']['listnav'] = self::$listnav;  
85 - $result['filter']['discount'] = self::getDiscount($filter['discount']);  
86 - $result['filter']['recent'] = self::recentShelve($filter['recent']);  
87 - $result['filter']['seniorChose'] = self::seniorChose($filter);  
88 - }  
89 - return $result;  
90 - }  
91 -  
92 - /**  
93 - * 组织列表模板数据  
94 - *  
95 - */  
96 - public static function getTemplateData($result, $options){  
97 - //模板数据  
98 - $data = array(  
99 - 'brandBanner' => array(),  
100 - 'pathNav' => $result['filter']['listnav'],  
101 - 'shopEntry' => array(),  
102 - 'filters' => array(  
103 - 'checkedConditions' => array(  
104 - 'conditions' => $result['filter']['selected'],  
105 - 'clearUrl' => $result['filter']['clear']  
106 - ),  
107 - 'channel' => $result['filter']['gender'],  
108 - 'sort' => array() ,  
109 - 'brand' => $result['filter']['brand'],  
110 - 'price' => $result['filter']['price'],  
111 - 'color' => $result['filter']['color'],  
112 - 'size' => $result['filter']['size'],  
113 - 'seniorChose' => $result['filter']['seniorChose']  
114 - ),  
115 - 'opts' => array(  
116 - 'sortType' => $result['filter']['sortType'],  
117 - 'checks' => $result['filter']['checks'],  
118 - 'fivePerLine' => true,  
119 - 'sixPerLineHref' => '',  
120 - 'countPerPage' => $options['viewNum'],  
121 - 'pageCounts' => $result['filter']['viewNum'],  
122 - 'curPage' => $result['page'],  
123 - 'pageCount' => $result['page_total'],  
124 - 'nextHref' => $result['filter']['next']  
125 - ),  
126 - 'hasNextPage' => array(  
127 - 'href' => $result['filter']['next'], 70 + //清除选中
  71 + $result['filters']['checkedConditions']['clearUrl'] = self::current();
  72 + //频道
  73 + $result['filters']['channel'] = self::gender($filter);
  74 + //分类
  75 + $result['filters']['sort'] = array();
  76 + //品牌
  77 + $result['filters']['brand'] = self::brand($filter);
  78 + //价格
  79 + $result['filters']['price'] = self::price($filter);
  80 + //颜色
  81 + $result['filters']['color'] = self::color($filter);
  82 + //尺寸
  83 + $result['filters']['size'] = self::size($filter);
  84 + //高级选项
  85 + $result['filters']['seniorChose'] = self::seniorChose($filter);
  86 + //排序方式
  87 + $result['opts']['sortType'] = array( self::orderDefault(),self::orderTime(),self::orderPrice(),self::orderDiscount());
  88 + //特殊:新品、特价、限量
  89 + $result['opts']['checks'] = array(self::isnew(),self::specialoffer(),self::limited());
  90 + //每行显示5个产品
  91 + $result['opts']['fivePerLine'] = true;
  92 + //每行显示6个产品
  93 + $result['opts']['sixPerLineHref'] = true;
  94 + //每页显示的数量
  95 + $result['opts']['countPerPage'] = $options['viewNum'];
  96 + //可选每页显示数量
  97 + $result['opts']['pageCounts'] = self::viewNum();
  98 + $result['opts']['curPage'] = self::$page;
  99 + $result['opts']['pageCount'] = $data['data']['page_total'];
  100 + $result['opts']['nextHref'] = self::next($data['data']['page_total'],$data['data']['filter']);
  101 + $result['hasNextPage'] = array(
  102 + 'href' => self::next($data['data']['page_total'],$data['data']['filter']),
128 'src' => 'http://img10.static.yhbimg.com/product/2014/01/15/11/01fa01614784f6239760f1b749663016f1.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90' 103 'src' => 'http://img10.static.yhbimg.com/product/2014/01/15/11/01fa01614784f6239760f1b749663016f1.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
129 - ),  
130 - 'goods' => $result['product_list'],  
131 - 'leftContent' => array(  
132 - array(  
133 - 'allSort' => array(  
134 - //'updateNum' => $result['filter']['group_sort']['all']['num'],  
135 - 'list' => $result['filter']['group_sort']['list']  
136 - )  
137 - ),  
138 - array(  
139 - 'advNav' => array()  
140 - ),  
141 - array(  
142 - 'advPic' => array()  
143 - ),  
144 - array(  
145 - 'newSales' => $result['filter']['recent']  
146 - ),  
147 - array('allDiscount' => $result['filter']['discount'])  
148 - ),  
149 - 'totalCount' => $result['total'],  
150 -  
151 ); 104 );
152 - return $data; 105 + //分类
  106 + $result['leftContent'][]['allSort'] = isset($filter['group_sort']) ? self::groupSort($filter['group_sort'], $options) : array();
  107 + //一周新品上架
  108 + $result['leftContent'][]['newSales'] = self::recentShelve($filter['recent']);
  109 + //全部折扣
  110 + $result['leftContent'][]['allDiscount'] = self::getDiscount($filter['discount']);
  111 + //总记录数
  112 + $result['totalCount'] = $data['data']['total'];
  113 + //分页
  114 + $result['pager'] = self::pager($result['totalCount'],$options['viewNum']);
  115 + //echo $result['pager']; exit;
  116 + //选中条件
  117 + $result['filters']['checkedConditions']['conditions'] = self::getSelected();
  118 + $result['pathNav'] = self::$listnav;
  119 + return $result;
153 } 120 }
  121 +
154 /** 122 /**
155 * TODO 组织商品列表信息 123 * TODO 组织商品列表信息
156 * @param $product 接口返回商品列表 124 * @param $product 接口返回商品列表
@@ -158,7 +126,7 @@ class HelperSearch @@ -158,7 +126,7 @@ class HelperSearch
158 * @return array 126 * @return array
159 */ 127 */
160 public static function getProductList($product,$imgSize){ 128 public static function getProductList($product,$imgSize){
161 - $result = array(); 129 + $goods = array();
162 foreach($product as $key => $val){ 130 foreach($product as $key => $val){
163 //NEW 131 //NEW
164 $isNew = $val['is_new'] == 'Y' ? true : false; 132 $isNew = $val['is_new'] == 'Y' ? true : false;
@@ -171,14 +139,13 @@ class HelperSearch @@ -171,14 +139,13 @@ class HelperSearch
171 //再到着 139 //再到着
172 //年终大促 140 //年终大促
173 // 年中大促 141 // 年中大促
174 -  
175 foreach($val['goods_list'] as $k => $v){ 142 foreach($val['goods_list'] as $k => $v){
176 $goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']); 143 $goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
177 } 144 }
178 if (!empty($val['default_images'])) { 145 if (!empty($val['default_images'])) {
179 $val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]); 146 $val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]);
180 } 147 }
181 - $result[] = array( 148 + $goods[] = array(
182 'tags' => array( 149 'tags' => array(
183 'isNew' => $isNew, 150 'isNew' => $isNew,
184 'isLimit' => $isLimit 151 'isLimit' => $isLimit
@@ -192,7 +159,7 @@ class HelperSearch @@ -192,7 +159,7 @@ class HelperSearch
192 'skn' => $val['product_skn'] 159 'skn' => $val['product_skn']
193 ); 160 );
194 } 161 }
195 - return $result; 162 + return $goods;
196 } 163 }
197 /** 164 /**
198 * 版型等其它筛选项 165 * 版型等其它筛选项
@@ -284,6 +251,7 @@ class HelperSearch @@ -284,6 +251,7 @@ class HelperSearch
284 * @return array 251 * @return array
285 */ 252 */
286 public static function groupSort($sort, $option = array()) { 253 public static function groupSort($sort, $option = array()) {
  254 + self::setListNav();
287 $params = self::$params; 255 $params = self::$params;
288 $gender = isset($params['gender']) ? $params['gender'] : ''; 256 $gender = isset($params['gender']) ? $params['gender'] : '';
289 257
@@ -385,16 +353,18 @@ class HelperSearch @@ -385,16 +353,18 @@ class HelperSearch
385 /** 353 /**
386 * 品牌,可以多选 354 * 品牌,可以多选
387 * @param array $brand 355 * @param array $brand
  356 + * @param array $options
388 * @return array 357 * @return array
389 */ 358 */
390 - public static function brand($filter) { 359 + public static function brand($filter, $options = array()) {
  360 + if (isset($options['brandName'])) {
  361 + return array();
  362 + }
391 $params = self::$params; 363 $params = self::$params;
392 $brand_ids = isset($params['brand']) && !empty($params['brand']) ? explode(',', $params['brand']) : array(); 364 $brand_ids = isset($params['brand']) && !empty($params['brand']) ? explode(',', $params['brand']) : array();
393 -  
394 if (isset($params['brand'])) { 365 if (isset($params['brand'])) {
395 unset($params['brand']); 366 unset($params['brand']);
396 } 367 }
397 -  
398 $result = array( 368 $result = array(
399 'default' => array() , 369 'default' => array() ,
400 'brandIndex' => array( 370 'brandIndex' => array(
@@ -412,14 +382,11 @@ class HelperSearch @@ -412,14 +382,11 @@ class HelperSearch
412 'U~Z' => array() , 382 'U~Z' => array() ,
413 ) 383 )
414 ); 384 );
415 -  
416 $brand_keys = array_reverse(array_keys($result['list'])); 385 $brand_keys = array_reverse(array_keys($result['list']));
417 if (isset($filter['brand']) && !empty($filter['brand'])) { 386 if (isset($filter['brand']) && !empty($filter['brand'])) {
418 -  
419 //有商品结果时 387 //有商品结果时
420 $brand = $filter['brand']; 388 $brand = $filter['brand'];
421 foreach ($brand as $v) { 389 foreach ($brand as $v) {
422 -  
423 if (!isset($v['brand_alif']) && isset($v['brand_name_en'])) { 390 if (!isset($v['brand_alif']) && isset($v['brand_name_en'])) {
424 $v['brand_alif'] = substr($v['brand_name_en'], 0, 1); 391 $v['brand_alif'] = substr($v['brand_name_en'], 0, 1);
425 } 392 }
@@ -429,7 +396,6 @@ class HelperSearch @@ -429,7 +396,6 @@ class HelperSearch
429 if (!isset($v['brand_domain'])) { 396 if (!isset($v['brand_domain'])) {
430 $v['brand_domain'] = ''; 397 $v['brand_domain'] = '';
431 } 398 }
432 -  
433 //选中的筛选条件 399 //选中的筛选条件
434 if (in_array($v['id'], $brand_ids)) { 400 if (in_array($v['id'], $brand_ids)) {
435 $selected_brand = explode(',', self::$params['brand']); 401 $selected_brand = explode(',', self::$params['brand']);
@@ -442,9 +408,7 @@ class HelperSearch @@ -442,9 +408,7 @@ class HelperSearch
442 'href' => self::buildurl($selected_params) 408 'href' => self::buildurl($selected_params)
443 ); 409 );
444 } 410 }
445 -  
446 $selected_brand = isset(self::$params['brand']) && !empty(self::$params['brand']) ? explode(',', self::$params['brand']) : array(); 411 $selected_brand = isset(self::$params['brand']) && !empty(self::$params['brand']) ? explode(',', self::$params['brand']) : array();
447 -  
448 if (empty($selected_brand)) { 412 if (empty($selected_brand)) {
449 $url = self::buildurl(array_merge($params, array( 413 $url = self::buildurl(array_merge($params, array(
450 'brand' => $v['id'] 414 'brand' => $v['id']
@@ -463,7 +427,6 @@ class HelperSearch @@ -463,7 +427,6 @@ class HelperSearch
463 'brand' => implode(',', $selected_brand) 427 'brand' => implode(',', $selected_brand)
464 ))); 428 )));
465 } 429 }
466 -  
467 $this_brand = array( 430 $this_brand = array(
468 'brand_id' => $v['id'], 431 'brand_id' => $v['id'],
469 'name' => $v['brand_name'], 432 'name' => $v['brand_name'],
@@ -471,7 +434,6 @@ class HelperSearch @@ -471,7 +434,6 @@ class HelperSearch
471 'href' => $url, 434 'href' => $url,
472 'active' => in_array($v['id'], $brand_ids) ? true : false 435 'active' => in_array($v['id'], $brand_ids) ? true : false
473 ); 436 );
474 -  
475 if (count($result['default']) < 10) { 437 if (count($result['default']) < 10) {
476 $result['default'][] = $this_brand; 438 $result['default'][] = $this_brand;
477 } 439 }
@@ -493,11 +455,9 @@ class HelperSearch @@ -493,11 +455,9 @@ class HelperSearch
493 } 455 }
494 } 456 }
495 else if (isset($filter['paramNames']) && isset($filter['paramNames']['brand'])) { 457 else if (isset($filter['paramNames']) && isset($filter['paramNames']['brand'])) {
496 -  
497 //无商品结果时且选择了品牌 458 //无商品结果时且选择了品牌
498 $brand = $filter['paramNames']['brand']; 459 $brand = $filter['paramNames']['brand'];
499 foreach ($brand as $v) { 460 foreach ($brand as $v) {
500 -  
501 //选中的筛选条件 461 //选中的筛选条件
502 if (in_array($v['id'], $brand_ids)) { 462 if (in_array($v['id'], $brand_ids)) {
503 $selected_brand = explode(',', self::$params['brand']); 463 $selected_brand = explode(',', self::$params['brand']);
@@ -764,7 +724,8 @@ class HelperSearch @@ -764,7 +724,8 @@ class HelperSearch
764 /** 724 /**
765 * 高级选项 725 * 高级选项
766 */ 726 */
767 - public static function seniorChose($filter){ 727 + public static function seniorChose($filter)
  728 + {
768 $style = self::style($filter); 729 $style = self::style($filter);
769 $other = self::standard($filter); 730 $other = self::standard($filter);
770 $result = array_merge($style,$other); 731 $result = array_merge($style,$other);
@@ -774,9 +735,9 @@ class HelperSearch @@ -774,9 +735,9 @@ class HelperSearch
774 /** 735 /**
775 * 每页显示数量 736 * 每页显示数量
776 */ 737 */
777 - public static function viewNum() { 738 + public static function viewNum()
  739 + {
778 $params = self::$params; 740 $params = self::$params;
779 -  
780 $view_num = array( 741 $view_num = array(
781 60, 742 60,
782 100, 743 100,
@@ -797,7 +758,8 @@ class HelperSearch @@ -797,7 +758,8 @@ class HelperSearch
797 /** 758 /**
798 * 显示行数 759 * 显示行数
799 */ 760 */
800 - public static function rowNum($num = 5) { 761 + public static function rowNum($num = 5)
  762 + {
801 $params = self::$params; 763 $params = self::$params;
802 764
803 $params['rowNum'] = $num; 765 $params['rowNum'] = $num;
@@ -808,7 +770,8 @@ class HelperSearch @@ -808,7 +770,8 @@ class HelperSearch
808 /** 770 /**
809 * 是否特价 771 * 是否特价
810 */ 772 */
811 - public static function specialoffer() { 773 + public static function specialoffer()
  774 + {
812 $params = self::$params; 775 $params = self::$params;
813 if (isset($params['specialoffer']) && !empty($params['specialoffer'])) { 776 if (isset($params['specialoffer']) && !empty($params['specialoffer'])) {
814 unset($params['specialoffer']); 777 unset($params['specialoffer']);
@@ -829,7 +792,8 @@ class HelperSearch @@ -829,7 +792,8 @@ class HelperSearch
829 /** 792 /**
830 * 是否限量 793 * 是否限量
831 */ 794 */
832 - public static function limited() { 795 + public static function limited()
  796 + {
833 $params = self::$params; 797 $params = self::$params;
834 if (isset($params['limited']) && !empty($params['limited'])) { 798 if (isset($params['limited']) && !empty($params['limited'])) {
835 unset($params['limited']); 799 unset($params['limited']);
@@ -849,7 +813,8 @@ class HelperSearch @@ -849,7 +813,8 @@ class HelperSearch
849 /** 813 /**
850 * 是否新品 814 * 是否新品
851 */ 815 */
852 - public static function isnew() { 816 + public static function isnew()
  817 + {
853 $params = self::$params; 818 $params = self::$params;
854 819
855 if (isset($params['isNew']) && !empty($params['isNew'])) { 820 if (isset($params['isNew']) && !empty($params['isNew'])) {
@@ -870,7 +835,8 @@ class HelperSearch @@ -870,7 +835,8 @@ class HelperSearch
870 /** 835 /**
871 * 排序是否最新 836 * 排序是否最新
872 */ 837 */
873 - public static function orderTime() { 838 + public static function orderTime()
  839 + {
874 $params = self::$params; 840 $params = self::$params;
875 if (isset($params['order'])) { 841 if (isset($params['order'])) {
876 unset($params['order']); 842 unset($params['order']);
@@ -888,7 +854,8 @@ class HelperSearch @@ -888,7 +854,8 @@ class HelperSearch
888 /** 854 /**
889 * 排序是否默认 855 * 排序是否默认
890 */ 856 */
891 - public static function orderDefault() { 857 + public static function orderDefault()
  858 + {
892 $params = self::$params; 859 $params = self::$params;
893 if (isset($params['order'])) { 860 if (isset($params['order'])) {
894 unset($params['order']); 861 unset($params['order']);
@@ -904,7 +871,8 @@ class HelperSearch @@ -904,7 +871,8 @@ class HelperSearch
904 /** 871 /**
905 * 价格排序 872 * 价格排序
906 */ 873 */
907 - public static function orderPrice() { 874 + public static function orderPrice()
  875 + {
908 $params = self::$params; 876 $params = self::$params;
909 if (isset($params['order'])) { 877 if (isset($params['order'])) {
910 unset($params['order']); 878 unset($params['order']);
@@ -946,7 +914,8 @@ class HelperSearch @@ -946,7 +914,8 @@ class HelperSearch
946 /** 914 /**
947 * 折扣排序 915 * 折扣排序
948 */ 916 */
949 - public static function orderDiscount() { 917 + public static function orderDiscount()
  918 + {
950 $params = self::$params; 919 $params = self::$params;
951 if (isset($params['order'])) { 920 if (isset($params['order'])) {
952 unset($params['order']); 921 unset($params['order']);
@@ -988,7 +957,8 @@ class HelperSearch @@ -988,7 +957,8 @@ class HelperSearch
988 /** 957 /**
989 * 获取自定义价格要提交的地址 958 * 获取自定义价格要提交的地址
990 */ 959 */
991 - public static function priceSubmit() { 960 + public static function priceSubmit()
  961 + {
992 $params = self::$params; 962 $params = self::$params;
993 $price = array(); 963 $price = array();
994 if (isset($params['price'])) { 964 if (isset($params['price'])) {
@@ -1030,7 +1000,8 @@ class HelperSearch @@ -1030,7 +1000,8 @@ class HelperSearch
1030 * @param array $params 1000 * @param array $params
1031 * @return string 1001 * @return string
1032 */ 1002 */
1033 - private static function buildurl($params) { 1003 + private static function buildurl($params)
  1004 + {
1034 if (empty($params)) { 1005 if (empty($params)) {
1035 return self::current(); 1006 return self::current();
1036 } 1007 }
@@ -1054,7 +1025,8 @@ class HelperSearch @@ -1054,7 +1025,8 @@ class HelperSearch
1054 /** 1025 /**
1055 * 获取选中的条件 1026 * 获取选中的条件
1056 */ 1027 */
1057 - public static function getSelected() { 1028 + public static function getSelected()
  1029 + {
1058 $result = array(); 1030 $result = array();
1059 $is_array_key = array( 1031 $is_array_key = array(
1060 'brand', 1032 'brand',
@@ -1078,7 +1050,8 @@ class HelperSearch @@ -1078,7 +1050,8 @@ class HelperSearch
1078 * @param array $list 1050 * @param array $list
1079 * @return array 1051 * @return array
1080 */ 1052 */
1081 - public static function getDiscount(array $list = array()) { 1053 + public static function getDiscount(array $list = array())
  1054 + {
1082 $params = self::$params; 1055 $params = self::$params;
1083 1056
1084 if (empty($list)) { 1057 if (empty($list)) {
@@ -1105,7 +1078,7 @@ class HelperSearch @@ -1105,7 +1078,7 @@ class HelperSearch
1105 } 1078 }
1106 $result = array( 1079 $result = array(
1107 //'updateNum' => $total, 1080 //'updateNum' => $total,
1108 - 'list' => $list 1081 + 'list' => array_values($list)
1109 ); 1082 );
1110 return $result; 1083 return $result;
1111 } 1084 }
@@ -1113,7 +1086,8 @@ class HelperSearch @@ -1113,7 +1086,8 @@ class HelperSearch
1113 /** 1086 /**
1114 * 最新上架 1087 * 最新上架
1115 */ 1088 */
1116 - public static function recentShelve($list = array()){ 1089 + public static function recentShelve($list = array())
  1090 + {
1117 if (empty($list)) { 1091 if (empty($list)) {
1118 return array(); 1092 return array();
1119 } 1093 }
@@ -1153,11 +1127,7 @@ class HelperSearch @@ -1153,11 +1127,7 @@ class HelperSearch
1153 */ 1127 */
1154 public static function current(){ 1128 public static function current(){
1155 $url = explode('?', $_SERVER['REQUEST_URI']); 1129 $url = explode('?', $_SERVER['REQUEST_URI']);
1156 - self::$current_url = $url[0];  
1157 - self::$listnav[0] = array(  
1158 - 'href' => '$url[0]',  
1159 - 'name' => '首页'  
1160 - ); 1130 + self::$listnav[0]['href'] = $url[0];
1161 return $url[0]; 1131 return $url[0];
1162 } 1132 }
1163 /** 1133 /**
@@ -1175,7 +1145,7 @@ class HelperSearch @@ -1175,7 +1145,7 @@ class HelperSearch
1175 } 1145 }
1176 1146
1177 /** 1147 /**
1178 - * 组织产品 1148 + * 组织产品的图片
1179 * @param $product 1149 * @param $product
1180 * @param $options 1150 * @param $options
1181 * @return array 1151 * @return array
@@ -1192,4 +1162,9 @@ class HelperSearch @@ -1192,4 +1162,9 @@ class HelperSearch
1192 } 1162 }
1193 return $result; 1163 return $result;
1194 } 1164 }
  1165 + //分页
  1166 + public static function pager($total,$view_num){
  1167 + $Paging = new Paging('Yoho');
  1168 + return $Paging->setTotal($total)->setSize($view_num)->view(0);
  1169 + }
1195 } 1170 }
  1 +<?php
  2 +namespace Plugin;
  3 +use \Hood\Paging as HPage;
  4 +class Paging extends HPage
  5 +{
  6 +
  7 + /**
  8 + * 路径
  9 + *
  10 + * @var String
  11 + */
  12 + private $path = '';
  13 +
  14 + /**
  15 + * 查询参数
  16 + * String or Array
  17 + * @var mixed
  18 + */
  19 + private $query;
  20 +
  21 + /**
  22 + * 分页集尺寸
  23 + *
  24 + * @var Integer
  25 + */
  26 + private $pageSetSize = 11;
  27 +
  28 + /**
  29 + * 子串
  30 + *
  31 + * @var String
  32 + */
  33 + private $substring = '?';
  34 +
  35 + /**
  36 + * 连接符号
  37 + *
  38 + * @var String
  39 + */
  40 + private $sign = '=';
  41 +
  42 + /**
  43 + * 对符
  44 + *
  45 + * @var String
  46 + */
  47 + private $pairs = '&';
  48 +
  49 + /**
  50 + * 模板路径
  51 + *
  52 + * @var String
  53 + */
  54 + private $templatePath = '';
  55 +
  56 + /**
  57 + * jsName
  58 + * @var String
  59 + */
  60 + private $jsFName = '';
  61 +
  62 + /**
  63 + * 废弃参数
  64 + * @var String
  65 + */
  66 + private $disuse = null;
  67 +
  68 + /**
  69 + * 设置分页链接中的关键字
  70 + *
  71 + * @var String
  72 + */
  73 + private $keyword = 'page';
  74 +
  75 + /**
  76 + * 是否开启rewrite url
  77 + *
  78 + * @var bool
  79 + */
  80 + private $rewrite = false;
  81 +
  82 + /**
  83 + * 附加参数
  84 + * @var string
  85 + */
  86 + private $appendParam = '';
  87 +
  88 + /**
  89 + * 分页中代码当前页码的常量
  90 + *
  91 + */
  92 + const PAGER_VARIABLE_STRING = "%{PAGE_NO}";
  93 +
  94 +
  95 + public function __construct($file)
  96 + {
  97 + $this->templatePath = __DIR__ . '/Paging/' . ucfirst($file) . '.php';
  98 + }
  99 +
  100 + /**
  101 + * 新的获取当前偏移
  102 + * @return Integer
  103 + */
  104 + public function getNewCurrent()
  105 + {
  106 + if ($this->currentPage > 1) {
  107 + return min($this->currentPage, $this->getPageNum());
  108 + }
  109 + $pageNo = !isset($_GET[$this->keyword]) ? 0 : (int)(intval($_GET[$this->keyword]) * $this->getSize()) - $this->getSize();
  110 + return (int)($pageNo < 0 ? 0 : $pageNo);
  111 + }
  112 +
  113 + /**
  114 + * 重载当前页方法
  115 + * @return Integer
  116 + */
  117 + public function getCurrent()
  118 + {
  119 + if ($this->currentPage > 1) {
  120 + return min($this->currentPage, $this->getPageNum());
  121 + }
  122 + $pageNo = isset($_GET[$this->keyword]) ? (int)intval($_GET[$this->keyword]) : 1;
  123 + if ($pageNo <= 0) {
  124 + $pageNo = 1;
  125 + }
  126 + $this->currentPage = min($pageNo, $this->getPageNum());
  127 + return $this->currentPage;
  128 + }
  129 +
  130 + /**
  131 + * 获取关键词
  132 + * @return String
  133 + */
  134 + public function getKeyword()
  135 + {
  136 + return $this->keyword;
  137 + }
  138 +
  139 + /**
  140 + * 设置关键词
  141 + *
  142 + * @param String $keyword
  143 + * @return QLib_Paging
  144 + */
  145 + public function setKeyword($keyword)
  146 + {
  147 + if (!empty($keyword)) {
  148 + $this->keyword = $keyword;
  149 + }
  150 + return $this;
  151 + }
  152 +
  153 + /**
  154 + * 设置js名字
  155 + * @param String $name
  156 + * @return Q_Page_Abstract
  157 + */
  158 + public function setFJs($name)
  159 + {
  160 + if (!empty($name)) {
  161 + $this->jsFName = $name;
  162 + }
  163 + return $this;
  164 + }
  165 +
  166 + /**
  167 + * 设置附加参数
  168 + * @param string $param
  169 + * @return Q_Page_Abstract
  170 + */
  171 + public function setAppendParam($param)
  172 + {
  173 + $this->appendParam = $param;
  174 + return $this;
  175 + }
  176 +
  177 + /**
  178 + * 获取附加参数
  179 + * @return string
  180 + */
  181 + public function getAppendParam()
  182 + {
  183 + return $this->appendParam;
  184 + }
  185 +
  186 + /**
  187 + * 获取分页js名字
  188 + * @return String
  189 + *
  190 + */
  191 + public function getFJs()
  192 + {
  193 + return $this->jsFName;
  194 + }
  195 +
  196 + /**
  197 + *
  198 + * 设置链接的路径
  199 + *
  200 + * @param String $path
  201 + * @return QLib_Paging
  202 + */
  203 + public function setPath($path)
  204 + {
  205 + if (!empty($path)) {
  206 + $this->path = trim($path);
  207 + }
  208 + return $this;
  209 + }
  210 +
  211 + /**
  212 + * 设置连续Url
  213 + *
  214 + * @param bool $seo
  215 + * @return QLib_Paging
  216 + */
  217 + public function rewrite($rw = true)
  218 + {
  219 + if ($rw == true) {
  220 + $this->substring = '';
  221 + $this->sign = '/';
  222 + $this->pairs = '/';
  223 + $this->rewrite = true;
  224 + }
  225 + return $this;
  226 + }
  227 +
  228 + /**
  229 + * 取得程序路径
  230 + * @return String
  231 + */
  232 + public function getPath()
  233 + {
  234 + return $this->path;
  235 + }
  236 +
  237 + /**
  238 + * 设置分页集尺寸
  239 + *
  240 + * @param integer $num 大于1
  241 + * @return QLib_Paging
  242 + */
  243 + public function setPageSetSize($num)
  244 + {
  245 + $this->pageSetSize = (int)intval($num);
  246 + return $this;
  247 + }
  248 +
  249 + /**
  250 + * 取得分页集尺寸
  251 + *
  252 + * @return integer
  253 + */
  254 + public function getPageSetSize()
  255 + {
  256 + return (int)$this->pageSetSize;
  257 + }
  258 +
  259 + /**
  260 + * 获取查询参数
  261 + * @return String
  262 + */
  263 + public function getQuery()
  264 + {
  265 + $query = $this->query;
  266 + if (empty($this->query)) {
  267 + $this->query = $this->autoUrl();
  268 + }
  269 + if (is_array($this->query) && count($this->query) > 0) {
  270 + $_query = array();
  271 + foreach ($this->query as $key => $value) {
  272 + if($key == '_pjax'){
  273 + break;
  274 + }
  275 + if ($key == $this->getKeyword()) {
  276 + continue;
  277 + }
  278 + if (is_array($value)) {
  279 + foreach ($value as $k => $val) {
  280 + $_query[] = "{$key}[]" . $this->sign . $val;
  281 + }
  282 + } else {
  283 + $_query[] = "{$key}" . $this->sign . $value;
  284 + }
  285 + }
  286 + $this->query = $this->pairs . implode($this->pairs, $_query);
  287 + }
  288 + return $this->query ? $this->query : '';
  289 + }
  290 +
  291 + /**
  292 + * 获取URL
  293 + *
  294 + * @param Integer $pageNo
  295 + * @return String
  296 + */
  297 + public function getUrl($pageNo)
  298 + {
  299 + $query = $this->getQuery();
  300 + if (strstr($query, self::PAGER_VARIABLE_STRING) && is_string($query)) {
  301 + $query = str_replace(self::PAGER_VARIABLE_STRING, $pageNo, $query);
  302 + } else {
  303 + if (empty($query)) {
  304 + $query = $this->getKeyword() . $this->sign . $pageNo;
  305 + } else {
  306 + $query = $this->getKeyword() . $this->sign . $pageNo . $query;
  307 + }
  308 + }
  309 + $url = $this->getPath() . $this->substring . $query;
  310 + if ($this->getFJs()) {
  311 + $url = $query;
  312 + }
  313 + return $url;
  314 + }
  315 +
  316 + /**
  317 + * 设置查询参数
  318 + *
  319 + * @param mixed $query String or Array
  320 + * @return QLib_Paging
  321 + */
  322 + public function setQuery($query)
  323 + {
  324 + $this->query = $query;
  325 + return $this;
  326 + }
  327 +
  328 + /**
  329 + * 设置模板路径
  330 + *
  331 + * @param String $path
  332 + * @return QLib_Paging
  333 + */
  334 + public function setTemplate($path)
  335 + {
  336 + $this->templatePath = $path;
  337 + return $this;
  338 + }
  339 +
  340 + /**
  341 + * 输出模板
  342 + */
  343 + public function view($print = true)
  344 + {
  345 + if ($this->getTotal() > 0) {
  346 + include($this->templatePath);
  347 + if($print){
  348 + print $html;
  349 + }else{
  350 + return $html;
  351 + }
  352 +
  353 + }
  354 + return '';
  355 + }
  356 +
  357 + /**
  358 + * 自动组织 URL
  359 + * @return Array
  360 + */
  361 + private function autoUrl()
  362 + {
  363 + $queryOpt = $_SERVER['REQUEST_URI'];
  364 + $queryArg = parse_url($queryOpt);
  365 + $queryOpt = isset($queryArg['query']) ? explode('&', $queryArg['query']) : array();
  366 + $query = array();
  367 + foreach ($queryOpt as $key => $val) {
  368 + $strTmp = explode('=', $val);
  369 + if (count($strTmp) < 2 || empty($strTmp[0]) || $strTmp[1] == '' || $strTmp[0] == $this->getKeyword()) {
  370 + continue;
  371 + }
  372 + if (is_array($this->disuse)) {
  373 + if (in_array($strTmp[1], $this->disuse) || in_array($strTmp[0], $this->disuse)) {
  374 + continue;
  375 + }
  376 + } else {
  377 + if ($strTmp[1] == $this->disuse || $strTmp[0] == $this->disuse) {
  378 + continue;
  379 + }
  380 + }
  381 + $query[$strTmp[0]] = $strTmp[1];
  382 + }
  383 + return $query;
  384 + }
  385 +
  386 + /**
  387 + * set废弃参数
  388 + * @param mixed $disuse
  389 + * @return QLib_Paging
  390 + */
  391 + public function setDisuse($disuse = null)
  392 + {
  393 + $this->disuse = $disuse;
  394 + return $this;
  395 + }
  396 +}
  1 +<?php
  2 +$pages = array();
  3 +$pageNum = $this->getPageNum(); #总分页数
  4 +$current = $this->getCurrent(); #当前页
  5 +$size = $this->getSize(); #每页显示数
  6 +$total = $this->getTotal(); #获取总数
  7 +$pageSetNum = $this->getPageSetSize(); #分页集数
  8 +$start = $end = 0;
  9 +if($current <= 4){
  10 + $start = 1;
  11 + $end = $start + 4;
  12 +}elseif(($pageNum - $current - 2) > 1)
  13 +{
  14 + $start = $current - 2 < 1 ? 1 : $current - 2;
  15 + $end = $current + 2;
  16 +}else{
  17 + $start = $current - 2;
  18 + $end = $pageNum;
  19 +}
  20 +if($end > $pageNum)
  21 +{
  22 + $end = $pageNum;
  23 +}
  24 +$startNum = $size * ($current - 1) + 1;
  25 +$endNum = min($size * $current, $total);
  26 +
  27 +$html = '';
  28 +if($current > 1)
  29 +{
  30 + $html .= '<a href="' . $this->getUrl($current - 1) . '" title="上一页"><span class="ifont10"><</span></a>';
  31 +}
  32 +if ($pageNum > 1) {
  33 + if($pageNum > 5 && $current > 4){
  34 + $html .= '<a href="' . $this->getUrl(1) . '"><span>' . 1 . '</span></a>';
  35 + $html .= '<a><span>...</span></a>';
  36 + $start = $current - 2;
  37 + $end = $pageNum - $current <= 3 ? $pageNum : $current + 2;
  38 + }
  39 + for ($i = $start; $i <= $end; ++$i) {
  40 + $_start = $size * ($i - 1) + 1;
  41 + $_end = min($size * $i, $total);
  42 + if ($i != $current) {
  43 + $html .= '<a href="' . $this->getUrl($i) . '"><span>' . $i . '</span></a>';
  44 + }
  45 + else {
  46 + $html .= '<a href="'. $this->getUrl($i) .'" class="cur"><span>' . $i . '</span></a>';
  47 + }
  48 + }
  49 + if($pageNum > 5 && $pageNum - $current > 3){
  50 + $html .= '<a><span>...</span></a>';
  51 + $html .= '<a href="' . $this->getUrl($pageNum) . '"><span>' . $pageNum . '</span></a>';
  52 + }
  53 +}
  54 +if ($current < $pageNum) {
  55 + $html .= '<a href="' . $this->getUrl($current + 1) . '" class="page_next" title="下一页"><span class="ifont10">></span></a>';
  56 +}
  1 +<?php
  2 +$pages = array();
  3 +$pageNum = $this->getPageNum(); #总分页数
  4 +$current = $this->getCurrent(); #当前页
  5 +$size = $this->getSize(); #每页显示数
  6 +$total = $this->getTotal(); #获取总数
  7 +$pageSetNum = $this->getPageSetSize(); #分页集数
  8 +$start = $end = 0;
  9 +if($current <= 4){
  10 + $start = 1;
  11 + $end = $start + 4;
  12 +}elseif(($pageNum - $current - 2) > 1)
  13 +{
  14 + $start = $current - 2 < 1 ? 1 : $current - 2;
  15 + $end = $current + 2;
  16 +}else{
  17 + $start = $current - 2;
  18 + $end = $pageNum;
  19 +}
  20 +if($end > $pageNum)
  21 +{
  22 + $end = $pageNum;
  23 +}
  24 +$startNum = $size * ($current - 1) + 1;
  25 +$endNum = min($size * $current, $total);
  26 +
  27 +$html = '<div class="left"><span class="rgb9">'.$startNum.' - '.$endNum.' / 共'.$total.'件商品</span></div><div class="goods-page right">';
  28 +if ($current > 1) {
  29 + $html .= '<a href="' . $this->getUrl($current - 1) . '" class="page_pre" title="上一页"><span class="ifont10"><</span>上一页</a>';
  30 +}
  31 +if ($pageNum > 1) {
  32 + if($pageNum > 5 && $current > 4){
  33 + $html .= '<a href="' . $this->getUrl(1) . '"><span>' . 1 . '</span></a>';
  34 + $html .= '<a><span>...</span></a>';
  35 + $start = $current - 2;
  36 + $end = $pageNum - $current <= 3 ? $pageNum : $current + 2;
  37 + }
  38 + for ($i = $start; $i <= $end; ++$i) {
  39 + $_start = $size * ($i - 1) + 1;
  40 + $_end = min($size * $i, $total);
  41 + if ($i != $current) {
  42 + $html .= '<a href="' . $this->getUrl($i) . '"><span>' . $i . '</span></a>';
  43 + }else {
  44 + $html .= '<a href="'. $this->getUrl($i) .'" class="cur"><span>' . $i . '</span></a>';
  45 + }
  46 + }
  47 + if($pageNum > 5 && $pageNum - $current > 3){
  48 + $html .= '<a><span>...</span></a>';
  49 + $html .= '<a href="' . $this->getUrl($pageNum) . '"><span>' . $pageNum . '</span></a>';
  50 + }
  51 +}
  52 +if ($current < $pageNum) {
  53 + $html .= '<a href="' . $this->getUrl($current + 1) . '" title="下一页">下一页<span class="ifont10">></span></a>';
  54 +}
  55 +$html .= '</div>';
  1 +<?php
  2 +$pages = array();
  3 +$pageNum = $this->getPageNum(); #总分页数
  4 +$current = $this->getCurrent(); #当前页
  5 +$size = $this->getSize(); #每页显示数
  6 +$total = $this->getTotal(); #获取总数
  7 +$pageSetNum = $this->getPageSetSize(); #分页集数
  8 +$start = $end = 0;
  9 +if($current <= 4){
  10 + $start = 1;
  11 + $end = $start + 4;
  12 +}elseif(($pageNum - $current - 2) > 1)
  13 +{
  14 + $start = $current - 2 < 1 ? 1 : $current - 2;
  15 + $end = $current + 2;
  16 +}else{
  17 + $start = $current - 2;
  18 + $end = $pageNum;
  19 +}
  20 +if($end > $pageNum)
  21 +{
  22 + $end = $pageNum;
  23 +}
  24 +$startNum = $size * ($current - 1) + 1;
  25 +$endNum = min($size * $current, $total);
  26 +
  27 +$html = '<div class="left"></div><div class="list-page right">';
  28 +if ($current > 1) {
  29 + $html .= '<a href="' . $this->getUrl($current - 1) . '" class="page_pre" title="上一页"><span class="ifont10"><</span>上一页</a>';
  30 +}
  31 +if ($pageNum > 1) {
  32 + if($pageNum >= 5 && $current > 4){
  33 + $html .= '<a href="' . $this->getUrl(1) . '"><span>' . 1 . '</span></a>';
  34 + $html .= '<a><span>...</span></a>';
  35 + $start = $current - 2;
  36 + $end = $pageNum - $current <= 3 ? $pageNum : $current + 2;
  37 + }
  38 + for ($i = $start; $i <= $end; ++$i) {
  39 + $_start = $size * ($i - 1) + 1;
  40 + $_end = min($size * $i, $total);
  41 + if ($i != $current) {
  42 + $html .= '<a href="' . $this->getUrl($i) . '"><span>' . $i . '</span></a>';
  43 + }else {
  44 + $html .= '<a href="'. $this->getUrl($i) .'" class="cur"><span>' . $i . '</span></a>';
  45 + }
  46 + }
  47 + if($pageNum > 5 && $pageNum - $current > 3){
  48 + $html .= '<a><span>...</span></a>';
  49 + $html .= '<a href="' . $this->getUrl($pageNum) . '"><span>' . $pageNum . '</span></a>';
  50 + }
  51 +}
  52 +if ($current < $pageNum) {
  53 + $html .= '<a href="' . $this->getUrl($current + 1) . '" title="下一页">下一页<span class="ifont10">></span></a>';
  54 +}
  55 +$html .= '</div>';
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 namespace Product; 2 namespace Product;
3 3
4 use Configs\CacheConfig; 4 use Configs\CacheConfig;
  5 +use Plugin\HelperSearchNew;
5 use Plugin\Images; 6 use Plugin\Images;
6 use Plugin\Cache; 7 use Plugin\Cache;
7 use Plugin\HelperSearch; 8 use Plugin\HelperSearch;
@@ -28,12 +29,15 @@ class SearchModel @@ -28,12 +29,15 @@ class SearchModel
28 * @author sefon 2015-12-17 16:12:18 29 * @author sefon 2015-12-17 16:12:18
29 * @return array 30 * @return array
30 */ 31 */
31 - public static function getSearchData($condition, $options,$classes) 32 + public static function getSearchData($condition, $options)
32 { 33 {
  34 + $data = array();
  35 +
33 // 调用接口查询商品数据 36 // 调用接口查询商品数据
34 $result = SearchData::searchElasticByCondition($condition); 37 $result = SearchData::searchElasticByCondition($condition);
  38 + if (isset($result['code']) && $result['code'] === 200) {
35 // 调用分类信息 39 // 调用分类信息
36 - $category = SearchData::getClassesData($classes); 40 + $category = SearchData::getClassesData();
37 if (isset($category['code']) && $category['code'] === 200) { 41 if (isset($category['code']) && $category['code'] === 200) {
38 $result['data']['filter']['group_sort'] = $category['data']['sort']; 42 $result['data']['filter']['group_sort'] = $category['data']['sort'];
39 } 43 }
@@ -48,13 +52,15 @@ class SearchModel @@ -48,13 +52,15 @@ class SearchModel
48 $result['data']['filter']['recent'] = $recent['data']['recent']; 52 $result['data']['filter']['recent'] = $recent['data']['recent'];
49 } 53 }
50 // 组织模板数据 54 // 组织模板数据
51 - if (isset($result['code']) && $result['code'] === 200) {  
52 - $res = HelperSearch::getList($result, $options);  
53 - $list = HelperSearch::getTemplateData($res, $options); 55 + $list = HelperSearch::getList($result, $options);
54 $data = array( 56 $data = array(
55 - 'productListPage' => true, //初始化js 57 + //初始化js
  58 + 'productListPage' => true,
56 'list' => $list 59 'list' => $list
57 ); 60 );
  61 + }else{
  62 + //接口异常,调用二级缓存
  63 + $data = array();
58 } 64 }
59 return $data; 65 return $data;
60 } 66 }
@@ -68,8 +74,6 @@ class SearchModel @@ -68,8 +74,6 @@ class SearchModel
68 */ 74 */
69 public static function getProductPic($product_sn, $options) 75 public static function getProductPic($product_sn, $options)
70 { 76 {
71 - $data = array();  
72 - $condition['query'] = $product_sn;  
73 $condition['query'] = $product_sn; 77 $condition['query'] = $product_sn;
74 //返回搜索条件 78 //返回搜索条件
75 $condition['needFilter'] = 0; 79 $condition['needFilter'] = 0;
@@ -81,7 +81,6 @@ class ListController extends WebAction @@ -81,7 +81,6 @@ class ListController extends WebAction
81 $params = $condition + $_GET; 81 $params = $condition + $_GET;
82 $params = array_filter($params); 82 $params = array_filter($params);
83 $data = SearchModel::getSearchData($params,$options); 83 $data = SearchModel::getSearchData($params,$options);
84 -// print_r($data); exit;  
85 $cate = array('boys','girls','kids','lifestyle'); 84 $cate = array('boys','girls','kids','lifestyle');
86 $this->setWebNavHeader($cate[$gender-1]); 85 $this->setWebNavHeader($cate[$gender-1]);
87 $this->_view->display('list', $data); 86 $this->_view->display('list', $data);