Authored by 郭成尧

'filter-params'

... ... @@ -128,10 +128,15 @@ class SearchModel
return $result;
}
public static function filter()
/**
* @param array $params 直接传筛选参数
* @return array
*/
public static function filter($params = array())
{
$data = array();
if (empty($params)) {
$condition = filter_input_array(INPUT_GET, array(
'query' => FILTER_DEFAULT,
'brand' => FILTER_DEFAULT,
... ... @@ -193,6 +198,10 @@ class SearchModel
$condition['style'] = rawurldecode($condition['style']);
}
} else {
$condition = $params;
}
// 区别各种列表页面的筛选数据
$data = self::getFilterData($condition);
... ...
... ... @@ -485,19 +485,26 @@ class IndexController extends AbstractAction
exit;
}
$filter = Product\SearchModel::filter();
/* tar add 160826 */
$data['shopIdForFilter'] = $shopId;
$data['gender'] = $this->get('gender');
$data['channel'] = $this->get('yh_channel') ? $this->get('yh_channel') : Helpers::getChannelByCookie();
$filter = Product\SearchModel::filter(array(
'shop' => $shopId,
'gender' => $data['gender'],
'channel' => $data['channel']
));
$data['filter'] = $filter['filter'];
/* tar add 160931 */
$data['goods'] = \Product\SearchModel::search(array(
'shop' => $shopId
'shop' => $shopId,
'gender' => $data['gender'],
'channel' => $data['channel']
));
/* tar add 160826 */
$data['shopIdForFilter'] = $shopId;
$data['gender'] = $this->get('gender');
$data['channel'] = $this->get('yh_channel') ? $this->get('yh_channel') : Helpers::getChannelByCookie();
$this->_view->display('shop', array(
'shopIndex' => $data,
'shopPage' => array(
... ...