|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use LibModels\Wap\Product\SearchData;
|
|
|
/**
|
|
|
* 搜索页
|
|
|
*/
|
...
|
...
|
@@ -41,4 +43,38 @@ class SearchController extends AbstractAction |
|
|
);
|
|
|
$this->_view->display('index', array('search' => $data, 'searchPage' => true, 'pageFooter' => true));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 模糊搜索指定字符
|
|
|
*
|
|
|
* @return array 模糊搜索的结果
|
|
|
*/
|
|
|
public function fuzzysearch()
|
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$keyword = $this->post('keyword', '');
|
|
|
|
|
|
$result = SearchData::searchFuzzyDatas($keyword);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据指定字符串查询数据
|
|
|
*
|
|
|
* @return array 搜索的结果
|
|
|
*/
|
|
|
public function listsearch()
|
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$query = $this->get('query', '');
|
|
|
|
|
|
$result = SearchData::searchLiDatas($query);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|