Authored by 周少峰

from 参数

... ... @@ -74,8 +74,7 @@ class HelperSearch
$result = array();
self::$params = $_GET;
self::$options = $options;
// unset(self::$params['/']);
// unset(self::$params['page']);
unset(self::$params['page']);
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
//产品列表
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
... ... @@ -558,6 +557,7 @@ class HelperSearch
$result = array();
$color = $filter['color'];
foreach ($color as $v) {
$checked = false;
//设置已选中
if ($v['color_id'] == $colorId) {
$background = empty($v['color_value']) ? '#' . $v['color_code'] : "url(" . $v['color_value'] . ")";
... ... @@ -565,6 +565,7 @@ class HelperSearch
'color' => $background,
'href' => self::buildUrl($params)
);
$checked = true;
}
$result[] = array(
'name' => $v['color_name'],
... ... @@ -572,6 +573,7 @@ class HelperSearch
'href' => self::buildUrl(array_merge($params, array(
'color' => $v['color_id']
))) ,
'checked' => $checked
);
}
if (self::checkSearch('color')) {
... ... @@ -1298,11 +1300,15 @@ class HelperSearch
}
//新品到着
elseif ($controller == 'list' && $action == 'new') {
$type = '';
if (isset(self::$params['shelve_time'])) {
$date = explode(',', self::$params['shelve_time']);
$date = date('Y-m-d', $date[0]);
}
$type = $date;
}
//list - sale
elseif ($controller == 'list' && $action == 'sale') {
$type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '';
$type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '0,0.9';
}
// 品牌
elseif ($controller == 'list' && $action == 'sale') {
... ...
... ... @@ -6,8 +6,8 @@ class SearchController extends WebAction
public function indexAction()
{
//当前控制器
$options['controller'] = $this->_request->controller;
$options['action'] = $this->_request->action;
$options['controller'] = 'Search';
$options['action'] = 'index';
//浏览记录数
$options['reviewNum'] = 7;
$searchData = SearchModel::searchData(array(),$options);
... ... @@ -16,8 +16,6 @@ class SearchController extends WebAction
'searchListPage' => true,
'search' => $searchData
);
// $this->setTitle();
// $this->setTitle();
$this->setWebNavHeader();
$this->_view->display('search', $data);
}
... ...