|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use LibModels\Wap\Product\SearchData;
|
|
|
// use LibModels\Wap\Product\SearchData;
|
|
|
use Plugin\DataProcess\ListProcess;
|
|
|
use Plugin\Helpers;
|
|
|
|
...
|
...
|
@@ -270,32 +270,22 @@ class SearchController extends AbstractAction |
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,), false);
|
|
|
|
|
|
// 转义分类
|
|
|
if (isset($condition['sort'])) {
|
|
|
$condition['sort'] = rawurldecode($condition['sort']);
|
|
|
}
|
|
|
// 转换折扣
|
|
|
if (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
unset($condition['discount']);
|
|
|
}
|
|
|
// 转义性别
|
|
|
if (isset($condition['gender'])) {
|
|
|
$condition['gender'] = rawurldecode($condition['gender']);
|
|
|
}
|
|
|
|
|
|
// 区别各种列表页面的筛选数据
|
|
|
if (isset($condition['brand'])) {
|
|
|
$title = '';
|
|
|
$listData = Product\ListModel::getBrandData($condition, $title);
|
|
|
} else if(isset($condition['sort'])) {
|
|
|
$listData = Product\ListModel::getClassData($condition);
|
|
|
} else {
|
|
|
$searchData = SearchData::searchByCondition($condition);
|
|
|
if (isset($searchData['data']) && isset($searchData['data']['filter'])) {
|
|
|
$listData['filter'] = ListProcess::getFilterData($searchData['data']['filter']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
($listData && isset($listData['filter'])) && $data['filter'] = $listData['filter'];
|
|
|
$listData = array();
|
|
|
$data = Product\FilterModel::getFilterData($condition);
|
|
|
}
|
|
|
|
|
|
if (empty($data)) {
|
...
|
...
|
@@ -310,7 +300,7 @@ class SearchController extends AbstractAction |
|
|
*
|
|
|
* @return array 模糊搜索的结果
|
|
|
*/
|
|
|
public function fuzzysearch()
|
|
|
/*public function fuzzysearch()
|
|
|
{
|
|
|
if ($this->isAjax()) {
|
|
|
$keyword = $this->post('keyword', '');
|
...
|
...
|
@@ -319,6 +309,6 @@ class SearchController extends AbstractAction |
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
} |
...
|
...
|
|