...
|
...
|
@@ -16,7 +16,6 @@ class HelperSearch |
|
|
public static $options = array();
|
|
|
//当前页
|
|
|
public static $page = 1;
|
|
|
public static $siteDomain = '.yohobuy.com';
|
|
|
|
|
|
/**
|
|
|
* 选中的条件
|
...
|
...
|
@@ -32,9 +31,6 @@ class HelperSearch |
|
|
//设置导航
|
|
|
private static function setListNav()
|
|
|
{
|
|
|
if (isset(self::$options['controller']) && self::$options['controller'] == 'Search') {
|
|
|
|
|
|
}
|
|
|
$options = self::$options;
|
|
|
$cookieChannel = isset($_COOKIE['_Channel']) ? $_COOKIE['_Channel'] : 'boys';
|
|
|
if (isset($options['brandName']) && !empty($options['brandName'])) {
|
...
|
...
|
@@ -226,6 +222,9 @@ class HelperSearch |
|
|
}
|
|
|
$params = self::$params;
|
|
|
$gender = isset($params['gender']) ? $params['gender'] : '';
|
|
|
if (isset($params['gender'])) {
|
|
|
unset($params['gender']);
|
|
|
}
|
|
|
//设置选中
|
|
|
if ($gender == '1,3' || $gender == '2,3') {
|
|
|
self::$selected['gender'] = array(
|
...
|
...
|
@@ -233,9 +232,7 @@ class HelperSearch |
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
}
|
|
|
if (isset($params['gender'])) {
|
|
|
unset($params['gender']);
|
|
|
}
|
|
|
|
|
|
if (self::checkSearch('gender')) {
|
|
|
return array();
|
|
|
}
|
...
|
...
|
@@ -259,12 +256,13 @@ class HelperSearch |
|
|
|
|
|
public static function groupSort($sort)
|
|
|
{
|
|
|
$option = self::$options;
|
|
|
if (!isset($option['controller']) || $option['controller'] != 'Search') {
|
|
|
|
|
|
$options = self::$options;
|
|
|
if (isset($options['controller']) && $options['controller'] != 'Search') {
|
|
|
return array();
|
|
|
}
|
|
|
//设置导航
|
|
|
self::setListNav($option);
|
|
|
self::setListNav($options);
|
|
|
$params = self::$params;
|
|
|
$result = array(
|
|
|
'all' => array(
|
...
|
...
|
@@ -304,6 +302,7 @@ class HelperSearch |
|
|
}
|
|
|
}
|
|
|
$result['list'] = $sortList;
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -318,22 +317,15 @@ class HelperSearch |
|
|
foreach ($sort as $key => $val) {
|
|
|
$result[$key]['id'] = $val['sort_id'];
|
|
|
$result[$key]['name'] = $val['sort_name'];
|
|
|
if (isset($params['msort']) && $params['msort'] == $val['sort_id']) {
|
|
|
unset($params['msort']);
|
|
|
self::$selected['sort'] = array(
|
|
|
'name' => $val['sort_name'],
|
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
}
|
|
|
if (isset($val['sub']) && !empty($val['sub'])) {
|
|
|
foreach ($val['sub'] as $k => $v) {
|
|
|
$result[$key]['sub'][$k]['href'] = self::buildUrl(array_merge($params, array('msort' => $val['sort_id'], 'misort' => $v['sort_id'])));
|
|
|
$result[$key]['sub'][$k]['href'] = self::buildUrl(array('msort' => $val['sort_id'], 'misort' => $v['sort_id']));
|
|
|
$result[$key]['sub'][$k]['name'] = $v['sort_name'];
|
|
|
if (isset($params['misort']) && $params['misort'] == $v['sort_id']) {
|
|
|
unset($params['misort']);
|
|
|
self::$selected['sort'] = array(
|
|
|
'name' => $v['sort_name'],
|
|
|
'href' => self::buildUrl($params)
|
|
|
'href' => self::buildUrl()
|
|
|
);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -425,10 +417,6 @@ class HelperSearch |
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
}
|
|
|
//搜索页已选中,返回空
|
|
|
if (self::checkSearch('brand')) {
|
|
|
return array();
|
|
|
}
|
|
|
ksort($brandList);
|
|
|
//品牌列表排序, 添加品牌索引
|
|
|
$index_key = array();
|
...
|
...
|
@@ -447,6 +435,10 @@ class HelperSearch |
|
|
}
|
|
|
unset($brandList);
|
|
|
}
|
|
|
//搜索页已选中,返回空
|
|
|
if (self::checkSearch('brand')) {
|
|
|
return array();
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
/**
|
...
|
...
|
@@ -471,9 +463,7 @@ class HelperSearch |
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
}
|
|
|
if (self::checkSearch('size')) {
|
|
|
return array();
|
|
|
}
|
|
|
|
|
|
$result[] = array(
|
|
|
'name' => $v['size_name'],
|
|
|
'href' => self::buildUrl(array_merge($params, array(
|
...
|
...
|
@@ -481,6 +471,9 @@ class HelperSearch |
|
|
))) ,
|
|
|
);
|
|
|
}
|
|
|
if (self::checkSearch('size')) {
|
|
|
return array();
|
|
|
}
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
...
|
...
|
@@ -1062,6 +1055,7 @@ class HelperSearch |
|
|
*/
|
|
|
public static function shop($shop)
|
|
|
{
|
|
|
$url = Helpers::url('','',$shop['brand_domain']);
|
|
|
$shopEntry = array();
|
|
|
$sort = array();
|
|
|
foreach ($shop['sort'] as $msort) {
|
...
|
...
|
@@ -1072,13 +1066,13 @@ class HelperSearch |
|
|
if (count($sort) >= 10) {
|
|
|
break 2;
|
|
|
}
|
|
|
$sortInfo['href'] = 'http://' . $shop['brand_domain'] . self::$siteDomain.'/?msort=' . $msort['sort_id'] . '&misort=' . $misort['sort_id'];
|
|
|
$sortInfo['href'] = $url.'/?msort=' . $msort['sort_id'] . '&misort=' . $misort['sort_id'];
|
|
|
$sortInfo['name'] = $misort['sort_name'];
|
|
|
$sort[] = $sortInfo;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
$shopEntry['home'] = $shop['brand_domain'].'yohobuy.com';
|
|
|
$shopEntry['home'] = $url;
|
|
|
$shopEntry['logo'] = Images::getSourceUrl($shop['brand_ico'],'brandLogo');
|
|
|
$shopEntry['shopName'] = $shop['brand_name'];
|
|
|
$shopEntry['sort'] = $sort;
|
...
|
...
|
|