...
|
...
|
@@ -110,6 +110,7 @@ class HelperSearch |
|
|
*/
|
|
|
public static function getProductList($product,$imgSize)
|
|
|
{
|
|
|
$params = self::$params;
|
|
|
$goods = array();
|
|
|
foreach($product as $key => $val){
|
|
|
//NEW
|
...
|
...
|
@@ -125,6 +126,10 @@ class HelperSearch |
|
|
// 年中大促
|
|
|
foreach($val['goods_list'] as $k => $v){
|
|
|
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
|
|
|
//筛选符合颜色条件的封面图片
|
|
|
if (isset($params['color']) && $params['color'] == $v['color_id']) {
|
|
|
$val['default_images'] = Images::getImageUrl($v['images_url'],$imgSize[0],$imgSize[1]);
|
|
|
}
|
|
|
}
|
|
|
if (!empty($val['default_images'])) {
|
|
|
$val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]);
|
...
|
...
|
@@ -439,6 +444,10 @@ class HelperSearch |
|
|
if (self::checkSearch('brand')) {
|
|
|
return array();
|
|
|
}
|
|
|
//品牌数量小于等于10,隐藏更多按钮
|
|
|
if (count($result['brandsShow']) < 11) {
|
|
|
$result['hideMore'] = true;
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
/**
|
...
|
...
|
@@ -613,18 +622,18 @@ class HelperSearch |
|
|
}
|
|
|
$result = array();
|
|
|
$style = $filter['style'];
|
|
|
$styleNum = 0;
|
|
|
$styleName = '';
|
|
|
foreach ($style as $v) {
|
|
|
//选中的筛选条件
|
|
|
if (in_array($v['style_id'], $styleIds)) {
|
|
|
$selectedStyle = explode(',', self::$params['style']);
|
|
|
$selectedKey = array_search($v['style_id'], $selectedStyle);
|
|
|
unset($selectedStyle[$selectedKey]);
|
|
|
$selectedParams = $params;
|
|
|
$selectedParams['style'] = implode(',', $selectedStyle);
|
|
|
self::$selected['style'][] = array(
|
|
|
'name' => $v['style_name'],
|
|
|
'href' => self::buildUrl($selectedParams)
|
|
|
);
|
|
|
if (!$styleNum) {
|
|
|
$styleName = $v['style_name']."、";
|
|
|
}
|
|
|
elseif ($styleNum ===1){
|
|
|
$styleName .= substr($v['style_name'], 0, 3).'...';
|
|
|
}
|
|
|
$styleNum ++;
|
|
|
}
|
|
|
$selectedStyle = isset(self::$params['style']) && !empty(self::$params['style']) ? explode(',', self::$params['style']) : array();
|
|
|
//风格id在提交的参数中,构造url参数去除该风格id
|
...
|
...
|
@@ -648,9 +657,11 @@ class HelperSearch |
|
|
'href' => $url,
|
|
|
);
|
|
|
}
|
|
|
//搜索页已选中,返回空
|
|
|
if (self::checkSearch('style')) {
|
|
|
return array();
|
|
|
if (isset(self::$params['style']) && !empty(self::$params['style'])) {
|
|
|
self::$selected['style'] = array(
|
|
|
'name' => rtrim($styleName, '、'),
|
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
}
|
|
|
$data[0] = array(
|
|
|
'attr' => 'style',
|
...
|
...
|
@@ -668,6 +679,10 @@ class HelperSearch |
|
|
$style = self::style($filter);
|
|
|
$other = self::standard($filter);
|
|
|
$result = array_merge($style,$other);
|
|
|
//搜索页已选中,返回空
|
|
|
if (self::checkSearch('style') || self::checkSearch('parameter')) {
|
|
|
return array();
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -926,7 +941,6 @@ class HelperSearch |
|
|
if ($data) {
|
|
|
$result['conditions'] = $data;
|
|
|
}
|
|
|
// print_r($result); exit;
|
|
|
return $result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -992,7 +1006,7 @@ class HelperSearch |
|
|
*/
|
|
|
public static function current()
|
|
|
{
|
|
|
$url = explode('?', $_SERVER['REQUEST_URI']);
|
|
|
$url = explode('?', 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
|
|
self::$listNav[0]['href'] = $url[0];
|
|
|
return $url[0];
|
|
|
}
|
...
|
...
|
@@ -1102,8 +1116,12 @@ class HelperSearch |
|
|
|
|
|
public static function checkSearch($param)
|
|
|
{
|
|
|
if (isset(self::$params[$param]) && isset(self::$options['controller']) && self::$options['controller'] == 'Search') {
|
|
|
return true;
|
|
|
if (isset(self::$options['controller']) && self::$options['controller'] == 'Search') {
|
|
|
foreach (self::$params as $key =>$val) {
|
|
|
if (strpos($key, $param) !== false) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
@@ -1354,7 +1372,9 @@ class HelperSearch |
|
|
//清除选中
|
|
|
$result['checkedConditions']['clearUrl'] = self::current();
|
|
|
//频道
|
|
|
$result['channel'] = self::gender(self::$filter);
|
|
|
$result['channel'] = array();
|
|
|
//性别
|
|
|
$result['gender'] = self::gender(self::$filter);
|
|
|
//品牌
|
|
|
$result['brand'] = self::brand(self::$filter);
|
|
|
//价格
|
...
|
...
|
|