Authored by 周少峰

from

@@ -638,6 +638,7 @@ class HelperSearch @@ -638,6 +638,7 @@ class HelperSearch
638 $styleNum = 0; 638 $styleNum = 0;
639 $styleName = ''; 639 $styleName = '';
640 foreach ($style as $v) { 640 foreach ($style as $v) {
  641 + $checked = false;
641 //选中的筛选条件 642 //选中的筛选条件
642 if (in_array($v['style_id'], $styleIds)) { 643 if (in_array($v['style_id'], $styleIds)) {
643 if (!$styleNum) { 644 if (!$styleNum) {
@@ -656,6 +657,7 @@ class HelperSearch @@ -656,6 +657,7 @@ class HelperSearch
656 $url = self::buildUrl(array_merge($params, array( 657 $url = self::buildUrl(array_merge($params, array(
657 'style' => implode(',', $selectedStyle) 658 'style' => implode(',', $selectedStyle)
658 ))); 659 )));
  660 + $checked = true;
659 } 661 }
660 //该风格url参数中添加该风格的id 662 //该风格url参数中添加该风格的id
661 else { 663 else {
@@ -668,6 +670,7 @@ class HelperSearch @@ -668,6 +670,7 @@ class HelperSearch
668 'id' => $v['style_id'], 670 'id' => $v['style_id'],
669 'name' => $v['style_name'], 671 'name' => $v['style_name'],
670 'href' => $url, 672 'href' => $url,
  673 + 'checked' => $checked
671 ); 674 );
672 } 675 }
673 if (isset(self::$params['style']) && !empty(self::$params['style'])) { 676 if (isset(self::$params['style']) && !empty(self::$params['style'])) {
@@ -1256,16 +1259,37 @@ class HelperSearch @@ -1256,16 +1259,37 @@ class HelperSearch
1256 */ 1259 */
1257 public static function fromPram($url, $position, $abEnabled = false) 1260 public static function fromPram($url, $position, $abEnabled = false)
1258 { 1261 {
  1262 + $type = '';
1259 $itemFrom = ChannelConfig::$itemFromStats; 1263 $itemFrom = ChannelConfig::$itemFromStats;
  1264 +
1260 $controller = isset(self::$options['controller']) ? strtolower(self::$options['controller']) : ''; 1265 $controller = isset(self::$options['controller']) ? strtolower(self::$options['controller']) : '';
1261 $action = isset(self::$options['action']) ? strtolower(self::$options['action']) : ''; 1266 $action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
  1267 + //列表页面
  1268 + if ($controller == 'list' && $action == 'index') {
  1269 + $type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : '';
  1270 + }
  1271 + //新品到着
  1272 + elseif ($controller == 'list' && $action == 'new') {
  1273 + $type = '';
  1274 + }
  1275 + //list - sale
  1276 + elseif ($controller == 'list' && $action == 'sale') {
  1277 + $type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '';
  1278 + }
  1279 + // 品牌
  1280 + elseif ($controller == 'list' && $action == 'sale') {
  1281 + $type = isset(self::$params['brandId']) && self::$params['brandId'] ? self::$params['brandId'] : '';
  1282 + }
  1283 + // 搜索
  1284 + elseif ($controller == 'search') {
  1285 + $type = isset(self::$params['query']) && self::$params['query'] ? self::$params['query'] : '';
  1286 + }
1262 $itemIndex = $controller."_".$action; 1287 $itemIndex = $controller."_".$action;
1263 //获取domain-module-$keyword_page_position{ab} 1288 //获取domain-module-$keyword_page_position{ab}
1264 $ab = (isset($_COOKIE['ab_5']) && $abEnabled == true) ? '_'.$_COOKIE['ab_5'] : ''; 1289 $ab = (isset($_COOKIE['ab_5']) && $abEnabled == true) ? '_'.$_COOKIE['ab_5'] : '';
1265 $page = self::$page; 1290 $page = self::$page;
1266 - $keyword = isset(self::$options['query']) ? self::$options['query'] : '';  
1267 if (isset($itemFrom[$itemIndex])) { 1291 if (isset($itemFrom[$itemIndex])) {
1268 - $url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$keyword}_{$page}_{$position}{$ab}"; 1292 + $url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$type}_{$page}_{$position}{$ab}";
1269 } 1293 }
1270 return $url; 1294 return $url;
1271 } 1295 }