Search.php
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
use Action\WebAction;
use Product\SearchModel;
class SearchController extends WebAction
{
public function indexAction()
{
$options['controller'] = $this->_request->controller;
$searchData = SearchModel::searchData(array(),$options);
$data = array(
//初始化js
'searchListPage' => true,
'search' => $searchData
);
$this->setWebNavHeader();
$this->_view->display('search', $data);
}
/**
* 搜索提示
*/
public function suggestAction()
{
$suggest = '';
$query = rawurldecode($this->get('query'));
if ($query) {
$param['query'] = $query;
$suggest = SearchModel::getSuggest($param);
}
echo $suggest;
}
/**
* 根据分类id,获取分类尺码
*/
public function sortSizeAction()
{
$condition['msort'] = $this->get('msort');
$size = SearchModel::getSortSize($condition);
$this->echoJson($size);
}
}