Showing
1 changed file
with
24 additions
and
14 deletions
@@ -622,18 +622,18 @@ class HelperSearch | @@ -622,18 +622,18 @@ class HelperSearch | ||
622 | } | 622 | } |
623 | $result = array(); | 623 | $result = array(); |
624 | $style = $filter['style']; | 624 | $style = $filter['style']; |
625 | + $styleNum = 0; | ||
626 | + $styleName = ''; | ||
625 | foreach ($style as $v) { | 627 | foreach ($style as $v) { |
626 | //选中的筛选条件 | 628 | //选中的筛选条件 |
627 | if (in_array($v['style_id'], $styleIds)) { | 629 | if (in_array($v['style_id'], $styleIds)) { |
628 | - $selectedStyle = explode(',', self::$params['style']); | ||
629 | - $selectedKey = array_search($v['style_id'], $selectedStyle); | ||
630 | - unset($selectedStyle[$selectedKey]); | ||
631 | - $selectedParams = $params; | ||
632 | - $selectedParams['style'] = implode(',', $selectedStyle); | ||
633 | - self::$selected['style'][] = array( | ||
634 | - 'name' => $v['style_name'], | ||
635 | - 'href' => self::buildUrl($selectedParams) | ||
636 | - ); | 630 | + if (!$styleNum) { |
631 | + $styleName = $v['style_name']."、"; | ||
632 | + } | ||
633 | + elseif ($styleNum ===1){ | ||
634 | + $styleName .= substr($v['style_name'], 0, 3).'...'; | ||
635 | + } | ||
636 | + $styleNum ++; | ||
637 | } | 637 | } |
638 | $selectedStyle = isset(self::$params['style']) && !empty(self::$params['style']) ? explode(',', self::$params['style']) : array(); | 638 | $selectedStyle = isset(self::$params['style']) && !empty(self::$params['style']) ? explode(',', self::$params['style']) : array(); |
639 | //风格id在提交的参数中,构造url参数去除该风格id | 639 | //风格id在提交的参数中,构造url参数去除该风格id |
@@ -657,9 +657,11 @@ class HelperSearch | @@ -657,9 +657,11 @@ class HelperSearch | ||
657 | 'href' => $url, | 657 | 'href' => $url, |
658 | ); | 658 | ); |
659 | } | 659 | } |
660 | - //搜索页已选中,返回空 | ||
661 | - if (self::checkSearch('style')) { | ||
662 | - return array(); | 660 | + if (isset(self::$params['style']) && !empty(self::$params['style'])) { |
661 | + self::$selected['style'] = array( | ||
662 | + 'name' => rtrim($styleName, '、'), | ||
663 | + 'href' => self::buildUrl($params) | ||
664 | + ); | ||
663 | } | 665 | } |
664 | $data[0] = array( | 666 | $data[0] = array( |
665 | 'attr' => 'style', | 667 | 'attr' => 'style', |
@@ -677,6 +679,10 @@ class HelperSearch | @@ -677,6 +679,10 @@ class HelperSearch | ||
677 | $style = self::style($filter); | 679 | $style = self::style($filter); |
678 | $other = self::standard($filter); | 680 | $other = self::standard($filter); |
679 | $result = array_merge($style,$other); | 681 | $result = array_merge($style,$other); |
682 | + //搜索页已选中,返回空 | ||
683 | + if (self::checkSearch('style') || self::checkSearch('parameter')) { | ||
684 | + return array(); | ||
685 | + } | ||
680 | return $result; | 686 | return $result; |
681 | } | 687 | } |
682 | 688 | ||
@@ -1110,8 +1116,12 @@ class HelperSearch | @@ -1110,8 +1116,12 @@ class HelperSearch | ||
1110 | 1116 | ||
1111 | public static function checkSearch($param) | 1117 | public static function checkSearch($param) |
1112 | { | 1118 | { |
1113 | - if (isset(self::$params[$param]) && isset(self::$options['controller']) && self::$options['controller'] == 'Search') { | ||
1114 | - return true; | 1119 | + if (isset(self::$options['controller']) && self::$options['controller'] == 'Search') { |
1120 | + foreach (self::$params as $key =>$val) { | ||
1121 | + if (strpos($key, $param) !== false) { | ||
1122 | + return true; | ||
1123 | + } | ||
1124 | + } | ||
1115 | } | 1125 | } |
1116 | 1126 | ||
1117 | } | 1127 | } |
-
Please register or login to post a comment