Authored by 周少峰

list_sale 默认搜素参数设置

... ... @@ -19,7 +19,7 @@ class SearchModel
/**
* 根据条件获取搜索数据
*
* @param $condition 搜索数据的条件
* @param $condition 搜索数据的条件
* @param $options Array([imgSize]
* => Array([0] => 235[1] => 314)[minImgSize] => Array([0] => 60[1] => 80)[gender] => 1[needPd] => Y[rowNum] => 5[viewNum] => 60)
* @author sefon 2015-12-17 16:12:18
... ... @@ -28,7 +28,6 @@ class SearchModel
public static function getSearchData($condition, $options)
{
$data = array();
// 调用接口查询商品数据
$result = SearchData::searchElasticByCondition($condition);
if (isset($result['code']) && $result['code'] === 200) {
... ...
... ... @@ -5,13 +5,13 @@ class ListController extends WebAction
{
public function indexAction()
{
}
public function newAction(){
}
/**
* list列表sale
*/
... ... @@ -48,11 +48,11 @@ class ListController extends WebAction
$condition['gender'] = $gender;
//每页显示商品数
if(!isset($condition['viewNum']) || empty($condition['viewNum'])){
$condition['viewNum'] =60;
$condition['viewNum'] =59;
}
$view_num_arr = array(60, 100, 200);
if (!in_array($condition['viewNum'], $view_num_arr)) {
$condition['viewNum'] = 60;
$condition['viewNum'] = 59;
}
//每行显示的商品数量
if(!isset($condition['rowNum']) || empty($condition['rowNum'])){
... ... @@ -70,14 +70,25 @@ class ListController extends WebAction
//$query = $this->get('query');
//返回搜索条件
$condition['needFilter'] = 1;
//过滤赠品
$condition['attribute_not'] = 2;
/*sale*/
//默认排序
if (!isset($condition['order']) || empty($condition['order'])) {
$condition['order'] = 's_n_desc';
}
if (!isset($condition['p_d']) || empty($condition['p_d'])) {
$condition['p_d'] = '0,0.9';
}
$options = array(
'imgSize' => $imgSize,
'minImgSize' => $minImgSize,
'gender' => $gender,
'needPd' => 'Y',
'rowNum' =>$condition['rowNum'],
'viewNum' =>$condition['viewNum'],
'viewNum' =>$condition['viewNum']-1,
);
$params = $condition + $_GET;
$params = array_filter($params);
$data = SearchModel::getSearchData($params,$options);
... ...