|
@@ -74,8 +74,7 @@ class HelperSearch |
|
@@ -74,8 +74,7 @@ class HelperSearch |
74
|
$result = array();
|
74
|
$result = array();
|
75
|
self::$params = $_GET;
|
75
|
self::$params = $_GET;
|
76
|
self::$options = $options;
|
76
|
self::$options = $options;
|
77
|
-// unset(self::$params['/']);
|
|
|
78
|
-// unset(self::$params['page']);
|
77
|
+ unset(self::$params['page']);
|
79
|
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
|
78
|
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
|
80
|
//产品列表
|
79
|
//产品列表
|
81
|
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
|
80
|
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
|
|
@@ -558,6 +557,7 @@ class HelperSearch |
|
@@ -558,6 +557,7 @@ class HelperSearch |
558
|
$result = array();
|
557
|
$result = array();
|
559
|
$color = $filter['color'];
|
558
|
$color = $filter['color'];
|
560
|
foreach ($color as $v) {
|
559
|
foreach ($color as $v) {
|
|
|
560
|
+ $checked = false;
|
561
|
//设置已选中
|
561
|
//设置已选中
|
562
|
if ($v['color_id'] == $colorId) {
|
562
|
if ($v['color_id'] == $colorId) {
|
563
|
$background = empty($v['color_value']) ? '#' . $v['color_code'] : "url(" . $v['color_value'] . ")";
|
563
|
$background = empty($v['color_value']) ? '#' . $v['color_code'] : "url(" . $v['color_value'] . ")";
|
|
@@ -565,6 +565,7 @@ class HelperSearch |
|
@@ -565,6 +565,7 @@ class HelperSearch |
565
|
'color' => $background,
|
565
|
'color' => $background,
|
566
|
'href' => self::buildUrl($params)
|
566
|
'href' => self::buildUrl($params)
|
567
|
);
|
567
|
);
|
|
|
568
|
+ $checked = true;
|
568
|
}
|
569
|
}
|
569
|
$result[] = array(
|
570
|
$result[] = array(
|
570
|
'name' => $v['color_name'],
|
571
|
'name' => $v['color_name'],
|
|
@@ -572,6 +573,7 @@ class HelperSearch |
|
@@ -572,6 +573,7 @@ class HelperSearch |
572
|
'href' => self::buildUrl(array_merge($params, array(
|
573
|
'href' => self::buildUrl(array_merge($params, array(
|
573
|
'color' => $v['color_id']
|
574
|
'color' => $v['color_id']
|
574
|
))) ,
|
575
|
))) ,
|
|
|
576
|
+ 'checked' => $checked
|
575
|
);
|
577
|
);
|
576
|
}
|
578
|
}
|
577
|
if (self::checkSearch('color')) {
|
579
|
if (self::checkSearch('color')) {
|
|
@@ -666,6 +668,7 @@ class HelperSearch |
|
@@ -666,6 +668,7 @@ class HelperSearch |
666
|
$styleNum = 0;
|
668
|
$styleNum = 0;
|
667
|
$styleName = '';
|
669
|
$styleName = '';
|
668
|
foreach ($style as $v) {
|
670
|
foreach ($style as $v) {
|
|
|
671
|
+ $checked = false;
|
669
|
//选中的筛选条件
|
672
|
//选中的筛选条件
|
670
|
if (in_array($v['style_id'], $styleIds)) {
|
673
|
if (in_array($v['style_id'], $styleIds)) {
|
671
|
if (!$styleNum) {
|
674
|
if (!$styleNum) {
|
|
@@ -684,6 +687,7 @@ class HelperSearch |
|
@@ -684,6 +687,7 @@ class HelperSearch |
684
|
$url = self::buildUrl(array_merge($params, array(
|
687
|
$url = self::buildUrl(array_merge($params, array(
|
685
|
'style' => implode(',', $selectedStyle)
|
688
|
'style' => implode(',', $selectedStyle)
|
686
|
)));
|
689
|
)));
|
|
|
690
|
+ $checked = true;
|
687
|
}
|
691
|
}
|
688
|
//该风格url参数中添加该风格的id
|
692
|
//该风格url参数中添加该风格的id
|
689
|
else {
|
693
|
else {
|
|
@@ -696,6 +700,7 @@ class HelperSearch |
|
@@ -696,6 +700,7 @@ class HelperSearch |
696
|
'id' => $v['style_id'],
|
700
|
'id' => $v['style_id'],
|
697
|
'name' => $v['style_name'],
|
701
|
'name' => $v['style_name'],
|
698
|
'href' => $url,
|
702
|
'href' => $url,
|
|
|
703
|
+ 'checked' => $checked
|
699
|
);
|
704
|
);
|
700
|
}
|
705
|
}
|
701
|
if (isset(self::$params['style']) && !empty(self::$params['style'])) {
|
706
|
if (isset(self::$params['style']) && !empty(self::$params['style'])) {
|
|
@@ -1284,16 +1289,41 @@ class HelperSearch |
|
@@ -1284,16 +1289,41 @@ class HelperSearch |
1284
|
*/
|
1289
|
*/
|
1285
|
public static function fromPram($url, $position, $abEnabled = false)
|
1290
|
public static function fromPram($url, $position, $abEnabled = false)
|
1286
|
{
|
1291
|
{
|
|
|
1292
|
+ $type = '';
|
1287
|
$itemFrom = ChannelConfig::$itemFromStats;
|
1293
|
$itemFrom = ChannelConfig::$itemFromStats;
|
|
|
1294
|
+
|
1288
|
$controller = isset(self::$options['controller']) ? strtolower(self::$options['controller']) : '';
|
1295
|
$controller = isset(self::$options['controller']) ? strtolower(self::$options['controller']) : '';
|
1289
|
$action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
|
1296
|
$action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
|
|
|
1297
|
+ //列表页面
|
|
|
1298
|
+ if ($controller == 'list' && $action == 'index') {
|
|
|
1299
|
+ $type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : '';
|
|
|
1300
|
+ }
|
|
|
1301
|
+ //新品到着
|
|
|
1302
|
+ elseif ($controller == 'list' && $action == 'new') {
|
|
|
1303
|
+ if (isset(self::$params['shelve_time'])) {
|
|
|
1304
|
+ $date = explode(',', self::$params['shelve_time']);
|
|
|
1305
|
+ $date = date('Y-m-d', $date[0]);
|
|
|
1306
|
+ }
|
|
|
1307
|
+ $type = $date;
|
|
|
1308
|
+ }
|
|
|
1309
|
+ //list - sale
|
|
|
1310
|
+ elseif ($controller == 'list' && $action == 'sale') {
|
|
|
1311
|
+ $type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '0,0.9';
|
|
|
1312
|
+ }
|
|
|
1313
|
+ // 品牌
|
|
|
1314
|
+ elseif ($controller == 'list' && $action == 'sale') {
|
|
|
1315
|
+ $type = isset(self::$params['brandId']) && self::$params['brandId'] ? self::$params['brandId'] : '';
|
|
|
1316
|
+ }
|
|
|
1317
|
+ // 搜索
|
|
|
1318
|
+ elseif ($controller == 'search') {
|
|
|
1319
|
+ $type = isset(self::$params['query']) && self::$params['query'] ? self::$params['query'] : '';
|
|
|
1320
|
+ }
|
1290
|
$itemIndex = $controller."_".$action;
|
1321
|
$itemIndex = $controller."_".$action;
|
1291
|
//获取domain-module-$keyword_page_position{ab}
|
1322
|
//获取domain-module-$keyword_page_position{ab}
|
1292
|
$ab = (isset($_COOKIE['ab_5']) && $abEnabled == true) ? '_'.$_COOKIE['ab_5'] : '';
|
1323
|
$ab = (isset($_COOKIE['ab_5']) && $abEnabled == true) ? '_'.$_COOKIE['ab_5'] : '';
|
1293
|
$page = self::$page;
|
1324
|
$page = self::$page;
|
1294
|
- $keyword = isset(self::$options['query']) ? self::$options['query'] : '';
|
|
|
1295
|
if (isset($itemFrom[$itemIndex])) {
|
1325
|
if (isset($itemFrom[$itemIndex])) {
|
1296
|
- $url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$keyword}_{$page}_{$position}{$ab}";
|
1326
|
+ $url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$type}_{$page}_{$position}{$ab}";
|
1297
|
}
|
1327
|
}
|
1298
|
return $url;
|
1328
|
return $url;
|
1299
|
}
|
1329
|
}
|