Authored by 周少峰

品牌多选

@@ -191,8 +191,7 @@ class HelperSearch @@ -191,8 +191,7 @@ class HelperSearch
191 $val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]); 191 $val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]);
192 } 192 }
193 //搜索关键字高亮 193 //搜索关键字高亮
194 - $patten = "/".self::$params['query']."/i";  
195 - if (isset(self::$params['query']) && !empty(self::$params['query']) && preg_match($patten, $val['product_name'], $match)) { 194 + if (isset(self::$params['query']) && !empty(self::$params['query']) && preg_match("/".self::$params['query']."/i", $val['product_name'], $match)) {
196 foreach ($match as $k => &$v) { 195 foreach ($match as $k => &$v) {
197 $replace[$k] = '<span style="color: #cc0000">'.$v.'</span>'; 196 $replace[$k] = '<span style="color: #cc0000">'.$v.'</span>';
198 $v = '/'.$v.'/'; 197 $v = '/'.$v.'/';