Authored by yangyang

Merge branch 'feature/web-list' of http://git.dev.yoho.cn/web/yohobuy into feature/web-list

@@ -16,7 +16,6 @@ class HelperSearch @@ -16,7 +16,6 @@ class HelperSearch
16 public static $options = array(); 16 public static $options = array();
17 //当前页 17 //当前页
18 public static $page = 1; 18 public static $page = 1;
19 - public static $siteDomain = '.yohobuy.com';  
20 19
21 /** 20 /**
22 * 选中的条件 21 * 选中的条件
@@ -32,9 +31,6 @@ class HelperSearch @@ -32,9 +31,6 @@ class HelperSearch
32 //设置导航 31 //设置导航
33 private static function setListNav() 32 private static function setListNav()
34 { 33 {
35 - if (isset(self::$options['controller']) && self::$options['controller'] == 'Search') {  
36 -  
37 - }  
38 $options = self::$options; 34 $options = self::$options;
39 $cookieChannel = isset($_COOKIE['_Channel']) ? $_COOKIE['_Channel'] : 'boys'; 35 $cookieChannel = isset($_COOKIE['_Channel']) ? $_COOKIE['_Channel'] : 'boys';
40 if (isset($options['brandName']) && !empty($options['brandName'])) { 36 if (isset($options['brandName']) && !empty($options['brandName'])) {
@@ -226,6 +222,9 @@ class HelperSearch @@ -226,6 +222,9 @@ class HelperSearch
226 } 222 }
227 $params = self::$params; 223 $params = self::$params;
228 $gender = isset($params['gender']) ? $params['gender'] : ''; 224 $gender = isset($params['gender']) ? $params['gender'] : '';
  225 + if (isset($params['gender'])) {
  226 + unset($params['gender']);
  227 + }
229 //设置选中 228 //设置选中
230 if ($gender == '1,3' || $gender == '2,3') { 229 if ($gender == '1,3' || $gender == '2,3') {
231 self::$selected['gender'] = array( 230 self::$selected['gender'] = array(
@@ -233,9 +232,7 @@ class HelperSearch @@ -233,9 +232,7 @@ class HelperSearch
233 'href' => self::buildUrl($params) 232 'href' => self::buildUrl($params)
234 ); 233 );
235 } 234 }
236 - if (isset($params['gender'])) {  
237 - unset($params['gender']);  
238 - } 235 +
239 if (self::checkSearch('gender')) { 236 if (self::checkSearch('gender')) {
240 return array(); 237 return array();
241 } 238 }
@@ -259,12 +256,13 @@ class HelperSearch @@ -259,12 +256,13 @@ class HelperSearch
259 256
260 public static function groupSort($sort) 257 public static function groupSort($sort)
261 { 258 {
262 - $option = self::$options;  
263 - if (!isset($option['controller']) || $option['controller'] != 'Search') { 259 +
  260 + $options = self::$options;
  261 + if (isset($options['controller']) && $options['controller'] != 'Search') {
264 return array(); 262 return array();
265 } 263 }
266 //设置导航 264 //设置导航
267 - self::setListNav($option); 265 + self::setListNav($options);
268 $params = self::$params; 266 $params = self::$params;
269 $result = array( 267 $result = array(
270 'all' => array( 268 'all' => array(
@@ -304,6 +302,7 @@ class HelperSearch @@ -304,6 +302,7 @@ class HelperSearch
304 } 302 }
305 } 303 }
306 $result['list'] = $sortList; 304 $result['list'] = $sortList;
  305 +
307 return $result; 306 return $result;
308 } 307 }
309 308
@@ -318,22 +317,15 @@ class HelperSearch @@ -318,22 +317,15 @@ class HelperSearch
318 foreach ($sort as $key => $val) { 317 foreach ($sort as $key => $val) {
319 $result[$key]['id'] = $val['sort_id']; 318 $result[$key]['id'] = $val['sort_id'];
320 $result[$key]['name'] = $val['sort_name']; 319 $result[$key]['name'] = $val['sort_name'];
321 - if (isset($params['msort']) && $params['msort'] == $val['sort_id']) {  
322 - unset($params['msort']);  
323 - self::$selected['sort'] = array(  
324 - 'name' => $val['sort_name'],  
325 - 'href' => self::buildUrl($params)  
326 - );  
327 - }  
328 if (isset($val['sub']) && !empty($val['sub'])) { 320 if (isset($val['sub']) && !empty($val['sub'])) {
329 foreach ($val['sub'] as $k => $v) { 321 foreach ($val['sub'] as $k => $v) {
330 - $result[$key]['sub'][$k]['href'] = self::buildUrl(array_merge($params, array('msort' => $val['sort_id'], 'misort' => $v['sort_id']))); 322 + $result[$key]['sub'][$k]['href'] = self::buildUrl(array('msort' => $val['sort_id'], 'misort' => $v['sort_id']));
331 $result[$key]['sub'][$k]['name'] = $v['sort_name']; 323 $result[$key]['sub'][$k]['name'] = $v['sort_name'];
332 if (isset($params['misort']) && $params['misort'] == $v['sort_id']) { 324 if (isset($params['misort']) && $params['misort'] == $v['sort_id']) {
333 unset($params['misort']); 325 unset($params['misort']);
334 self::$selected['sort'] = array( 326 self::$selected['sort'] = array(
335 'name' => $v['sort_name'], 327 'name' => $v['sort_name'],
336 - 'href' => self::buildUrl($params) 328 + 'href' => self::buildUrl()
337 ); 329 );
338 } 330 }
339 331
@@ -425,10 +417,6 @@ class HelperSearch @@ -425,10 +417,6 @@ class HelperSearch
425 'href' => self::buildUrl($params) 417 'href' => self::buildUrl($params)
426 ); 418 );
427 } 419 }
428 - //搜索页已选中,返回空  
429 - if (self::checkSearch('brand')) {  
430 - return array();  
431 - }  
432 ksort($brandList); 420 ksort($brandList);
433 //品牌列表排序, 添加品牌索引 421 //品牌列表排序, 添加品牌索引
434 $index_key = array(); 422 $index_key = array();
@@ -447,6 +435,10 @@ class HelperSearch @@ -447,6 +435,10 @@ class HelperSearch
447 } 435 }
448 unset($brandList); 436 unset($brandList);
449 } 437 }
  438 + //搜索页已选中,返回空
  439 + if (self::checkSearch('brand')) {
  440 + return array();
  441 + }
450 return $result; 442 return $result;
451 } 443 }
452 /** 444 /**
@@ -471,9 +463,7 @@ class HelperSearch @@ -471,9 +463,7 @@ class HelperSearch
471 'href' => self::buildUrl($params) 463 'href' => self::buildUrl($params)
472 ); 464 );
473 } 465 }
474 - if (self::checkSearch('size')) {  
475 - return array();  
476 - } 466 +
477 $result[] = array( 467 $result[] = array(
478 'name' => $v['size_name'], 468 'name' => $v['size_name'],
479 'href' => self::buildUrl(array_merge($params, array( 469 'href' => self::buildUrl(array_merge($params, array(
@@ -481,6 +471,9 @@ class HelperSearch @@ -481,6 +471,9 @@ class HelperSearch
481 ))) , 471 ))) ,
482 ); 472 );
483 } 473 }
  474 + if (self::checkSearch('size')) {
  475 + return array();
  476 + }
484 } 477 }
485 return $result; 478 return $result;
486 } 479 }
@@ -1062,6 +1055,7 @@ class HelperSearch @@ -1062,6 +1055,7 @@ class HelperSearch
1062 */ 1055 */
1063 public static function shop($shop) 1056 public static function shop($shop)
1064 { 1057 {
  1058 + $url = Helpers::url('','',$shop['brand_domain']);
1065 $shopEntry = array(); 1059 $shopEntry = array();
1066 $sort = array(); 1060 $sort = array();
1067 foreach ($shop['sort'] as $msort) { 1061 foreach ($shop['sort'] as $msort) {
@@ -1072,13 +1066,13 @@ class HelperSearch @@ -1072,13 +1066,13 @@ class HelperSearch
1072 if (count($sort) >= 10) { 1066 if (count($sort) >= 10) {
1073 break 2; 1067 break 2;
1074 } 1068 }
1075 - $sortInfo['href'] = 'http://' . $shop['brand_domain'] . self::$siteDomain.'/?msort=' . $msort['sort_id'] . '&misort=' . $misort['sort_id']; 1069 + $sortInfo['href'] = $url.'/?msort=' . $msort['sort_id'] . '&misort=' . $misort['sort_id'];
1076 $sortInfo['name'] = $misort['sort_name']; 1070 $sortInfo['name'] = $misort['sort_name'];
1077 $sort[] = $sortInfo; 1071 $sort[] = $sortInfo;
1078 } 1072 }
1079 1073
1080 } 1074 }
1081 - $shopEntry['home'] = $shop['brand_domain'].'yohobuy.com'; 1075 + $shopEntry['home'] = $url;
1082 $shopEntry['logo'] = Images::getSourceUrl($shop['brand_ico'],'brandLogo'); 1076 $shopEntry['logo'] = Images::getSourceUrl($shop['brand_ico'],'brandLogo');
1083 $shopEntry['shopName'] = $shop['brand_name']; 1077 $shopEntry['shopName'] = $shop['brand_name'];
1084 $shopEntry['sort'] = $sort; 1078 $shopEntry['sort'] = $sort;
@@ -28,7 +28,7 @@ class HomeModel @@ -28,7 +28,7 @@ class HomeModel
28 /* 女生楼层资源的位置码 */ 28 /* 女生楼层资源的位置码 */
29 const CODE_FLOOR_GIRLS = '189b6686065dbd6755dd6906cf03c002'; 29 const CODE_FLOOR_GIRLS = '189b6686065dbd6755dd6906cf03c002';
30 /* 潮童楼层资源的位置码 */ 30 /* 潮童楼层资源的位置码 */
31 - const CODE_FLOOR_KIDS = 'b8c1bff53d4ea60f978926d538620636'; // '66cad79d93e055ad6fc5c8744086066d'; 31 + const CODE_FLOOR_KIDS = '66cad79d93e055ad6fc5c8744086066d'; // 'b8c1bff53d4ea60f978926d538620636';
32 /* 创意生活楼层资源的位置码 */ 32 /* 创意生活楼层资源的位置码 */
33 const CODE_FLOOR_LIFESTYLE = '61cd852c6afcf60660196154f66a3a62'; 33 const CODE_FLOOR_LIFESTYLE = '61cd852c6afcf60660196154f66a3a62';
34 34