...
|
...
|
@@ -392,16 +392,30 @@ class HelperSearch |
|
|
//清空品牌参数
|
|
|
unset($params['brand']);
|
|
|
//设置已选中的品牌
|
|
|
$existBrandNum = 0;
|
|
|
$existName = '';
|
|
|
foreach ($brandIds as $key => $val) {
|
|
|
if (isset($brandAll[$val])) {
|
|
|
$brandParam = $brandIds;
|
|
|
unset($brandParam[$key]);
|
|
|
$params['brand'] = implode(',', $brandParam);
|
|
|
self::$selected['brand'] = array(
|
|
|
'name' => $brandAll[$val],
|
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
if ($existBrandNum === 0) {
|
|
|
$existName .= $brandAll[$val].'、';
|
|
|
}
|
|
|
if ($existBrandNum === 1){
|
|
|
$existName .= substr($brandAll[$val], 0, 3).'...';
|
|
|
}
|
|
|
$existBrandNum++;
|
|
|
}
|
|
|
if ($existBrandNum > 1) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
//设置选中
|
|
|
if (isset(self::$params['brand']) && !empty(self::$params['brand'])) {
|
|
|
self::$selected['brand'] = array(
|
|
|
'name' => rtrim($existName, '、'),
|
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
}
|
|
|
ksort($brandList);
|
|
|
//品牌列表排序, 添加品牌索引
|
...
|
...
|
@@ -432,9 +446,13 @@ class HelperSearch |
|
|
* @param array $filter
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function size($filter)
|
|
|
public static function size($filter, $isAjax = false)
|
|
|
{
|
|
|
$params = self::$params;
|
|
|
$paramsValue = array_filter($params);
|
|
|
if (!$isAjax && empty($paramsValue)) {
|
|
|
return array();
|
|
|
}
|
|
|
$sizeId = isset($params['size']) && !empty($params['size']) ? $params['size'] : '';
|
|
|
if (isset($params['size'])) {
|
|
|
unset($params['size']);
|
...
|
...
|
@@ -694,7 +712,7 @@ class HelperSearch |
|
|
$selected = true;
|
|
|
}
|
|
|
else {
|
|
|
$params['specialoffer'] = 1;
|
|
|
$params['specialoffer'] = 'Y';
|
|
|
}
|
|
|
return array(
|
|
|
'name' => '打折',
|
...
|
...
|
@@ -731,12 +749,12 @@ class HelperSearch |
|
|
{
|
|
|
$params = self::$params;
|
|
|
$selected = '';
|
|
|
if (isset($params['isNew']) && !empty($params['isNew'])) {
|
|
|
unset($params['isNew']);
|
|
|
if (isset($params['new']) && !empty($params['new'])) {
|
|
|
unset($params['new']);
|
|
|
$selected = true;
|
|
|
}
|
|
|
else {
|
|
|
$params['isNew'] = 'Y';
|
|
|
$params['new'] = 'Y';
|
|
|
}
|
|
|
return array(
|
|
|
'name' => '新品',
|
...
|
...
|
@@ -843,7 +861,6 @@ class HelperSearch |
|
|
)));
|
|
|
$active = '';
|
|
|
$desc = true;
|
|
|
|
|
|
}
|
|
|
else if (self::$params['order'] == 'p_d_asc') {
|
|
|
$url = self::buildUrl(array_merge($params, array(
|
...
|
...
|
@@ -903,23 +920,13 @@ class HelperSearch |
|
|
{
|
|
|
$result = array();
|
|
|
$data = array();
|
|
|
$is_array_key = array(
|
|
|
'brand',
|
|
|
'style'
|
|
|
);
|
|
|
foreach (self::$selected as $key => $val) {
|
|
|
if (in_array($key, $is_array_key)) {
|
|
|
foreach ($val as $k => $v) {
|
|
|
$data[] = $v;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
$data[] = $val;
|
|
|
}
|
|
|
}
|
|
|
if ($data) {
|
|
|
$result['conditions'] = $data;
|
|
|
}
|
|
|
// print_r($result); exit;
|
|
|
return $result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1305,7 +1312,8 @@ class HelperSearch |
|
|
elseif ($type == 'shop') {
|
|
|
return 'http://101.200.31.165/yohosearch/shops.json';
|
|
|
}
|
|
|
return 'http://192.168.10.64:8080/yohosearch/search-once.json';
|
|
|
return 'http://101.200.31.165/yohosearch/search.json';
|
|
|
// return 'http://192.168.10.64:8080/yohosearch/search-once.json';
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|