...
|
...
|
@@ -71,8 +71,7 @@ class HelperSearch |
|
|
$result = array();
|
|
|
self::$params = $_GET;
|
|
|
self::$options = $options;
|
|
|
// unset(self::$params['/']);
|
|
|
// unset(self::$params['page']);
|
|
|
unset(self::$params['page']);
|
|
|
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
|
|
|
//产品列表
|
|
|
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
|
...
|
...
|
@@ -555,6 +554,7 @@ class HelperSearch |
|
|
$result = array();
|
|
|
$color = $filter['color'];
|
|
|
foreach ($color as $v) {
|
|
|
$checked = false;
|
|
|
//设置已选中
|
|
|
if ($v['color_id'] == $colorId) {
|
|
|
$background = empty($v['color_value']) ? '#' . $v['color_code'] : "url(" . $v['color_value'] . ")";
|
...
|
...
|
@@ -562,6 +562,7 @@ class HelperSearch |
|
|
'color' => $background,
|
|
|
'href' => self::buildUrl($params)
|
|
|
);
|
|
|
$checked = true;
|
|
|
}
|
|
|
$result[] = array(
|
|
|
'name' => $v['color_name'],
|
...
|
...
|
@@ -569,6 +570,7 @@ class HelperSearch |
|
|
'href' => self::buildUrl(array_merge($params, array(
|
|
|
'color' => $v['color_id']
|
|
|
))) ,
|
|
|
'checked' => $checked
|
|
|
);
|
|
|
}
|
|
|
if (self::checkSearch('color')) {
|
...
|
...
|
@@ -663,6 +665,7 @@ class HelperSearch |
|
|
$styleNum = 0;
|
|
|
$styleName = '';
|
|
|
foreach ($style as $v) {
|
|
|
$checked = false;
|
|
|
//选中的筛选条件
|
|
|
if (in_array($v['style_id'], $styleIds)) {
|
|
|
if (!$styleNum) {
|
...
|
...
|
@@ -681,6 +684,7 @@ class HelperSearch |
|
|
$url = self::buildUrl(array_merge($params, array(
|
|
|
'style' => implode(',', $selectedStyle)
|
|
|
)));
|
|
|
$checked = true;
|
|
|
}
|
|
|
//该风格url参数中添加该风格的id
|
|
|
else {
|
...
|
...
|
@@ -693,6 +697,7 @@ class HelperSearch |
|
|
'id' => $v['style_id'],
|
|
|
'name' => $v['style_name'],
|
|
|
'href' => $url,
|
|
|
'checked' => $checked
|
|
|
);
|
|
|
}
|
|
|
if (isset(self::$params['style']) && !empty(self::$params['style'])) {
|
...
|
...
|
@@ -1281,16 +1286,41 @@ class HelperSearch |
|
|
*/
|
|
|
public static function fromPram($url, $position, $abEnabled = false)
|
|
|
{
|
|
|
$type = '';
|
|
|
$itemFrom = ChannelConfig::$itemFromStats;
|
|
|
|
|
|
$controller = isset(self::$options['controller']) ? strtolower(self::$options['controller']) : '';
|
|
|
$action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
|
|
|
//列表页面
|
|
|
if ($controller == 'list' && $action == 'index') {
|
|
|
$type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : '';
|
|
|
}
|
|
|
//新品到着
|
|
|
elseif ($controller == 'list' && $action == 'new') {
|
|
|
if (isset(self::$params['shelve_time'])) {
|
|
|
$date = explode(',', self::$params['shelve_time']);
|
|
|
$date = date('Y-m-d', $date[0]);
|
|
|
}
|
|
|
$type = $date;
|
|
|
}
|
|
|
//list - sale
|
|
|
elseif ($controller == 'list' && $action == 'sale') {
|
|
|
$type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '0,0.9';
|
|
|
}
|
|
|
// 品牌
|
|
|
elseif ($controller == 'list' && $action == 'sale') {
|
|
|
$type = isset(self::$params['brandId']) && self::$params['brandId'] ? self::$params['brandId'] : '';
|
|
|
}
|
|
|
// 搜索
|
|
|
elseif ($controller == 'search') {
|
|
|
$type = isset(self::$params['query']) && self::$params['query'] ? self::$params['query'] : '';
|
|
|
}
|
|
|
$itemIndex = $controller."_".$action;
|
|
|
//获取domain-module-$keyword_page_position{ab}
|
|
|
$ab = (isset($_COOKIE['ab_5']) && $abEnabled == true) ? '_'.$_COOKIE['ab_5'] : '';
|
|
|
$page = self::$page;
|
|
|
$keyword = isset(self::$options['query']) ? self::$options['query'] : '';
|
|
|
if (isset($itemFrom[$itemIndex])) {
|
|
|
$url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$keyword}_{$page}_{$position}{$ab}";
|
|
|
$url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$type}_{$page}_{$position}{$ab}";
|
|
|
}
|
|
|
return $url;
|
|
|
}
|
...
|
...
|
|