Authored by 周少峰

风格选项大于2个,显示多选按钮

... ... @@ -328,10 +328,14 @@ class HelperSearch
return $result;
}
/**
* 搜索页分类筛选条件
* @param $sort
* @return array
*/
public static function searchSort($sort)
{
$result = array();
$options = self::$options;
$params = self::$params;
foreach ($sort as $key => $val) {
$result[$key]['id'] = $val['sort_id'];
... ... @@ -473,7 +477,6 @@ class HelperSearch
if (count($result['brandsShow']) < 11) {
$result['hideMore'] = true;
}
// print_r($result); exit;
return $result;
}
/**
... ... @@ -641,6 +644,7 @@ class HelperSearch
*/
public static function style($filter)
{
$data = array();
$params = self::$params;
$styleIds = isset($params['style']) && !empty($params['style']) ? explode(',', $params['style']) : array();
if (isset($params['style'])) {
... ... @@ -689,12 +693,14 @@ class HelperSearch
'href' => self::buildUrl($params)
);
}
$data[0] = array(
'attr' => 'style',
'name' => '风格',
'showMulti' => true,
'sub' => $result
);
if ($result) {
$data[0] = array(
'attr' => 'style',
'name' => '风格',
'showMulti' => count($result) > 1 ? true : false,
'sub' => $result
);
}
return $data;
}
/**
... ...
... ... @@ -5,7 +5,10 @@ class SearchController extends WebAction
{
public function indexAction()
{
//当前控制器
$options['controller'] = $this->_request->controller;
//浏览记录数
$options['reviewNum'] = 7;
$searchData = SearchModel::searchData(array(),$options);
$data = array(
//初始化js
... ...