...
|
...
|
@@ -44,7 +44,7 @@ class SearchController extends AbstractAction |
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,), false);
|
|
|
|
|
|
$query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null;
|
|
|
$query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
|
|
|
if (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
unset($condition['discount']);
|
...
|
...
|
@@ -99,7 +99,6 @@ class SearchController extends AbstractAction |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/* 判断是不是品类, 是品类加导航标题(不显示搜索框) */
|
|
|
if ($haveQuery) {
|
|
|
$classNames = Category\ClassModel::getClassNames();
|
...
|
...
|
@@ -148,25 +147,25 @@ class SearchController extends AbstractAction |
|
|
$data['goodList'] = $condition;
|
|
|
$data['query'] = $query;
|
|
|
|
|
|
// 查询数据
|
|
|
if (!isset($condition['query'])) {
|
|
|
$data['goodList'] += Product\ListModel::getClassData($condition);
|
|
|
} else {
|
|
|
$listData = SearchData::searchByCondition($condition);
|
|
|
// 处理返回的数据
|
|
|
if (!empty($listData['data']['brand'])) {
|
|
|
$brandData = $listData['data']['brand'];
|
|
|
$data['brandWay'] = array(
|
|
|
'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
|
|
|
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
|
|
|
'name' => $brandData['brand_name']
|
|
|
);
|
|
|
// 设置品牌默认值
|
|
|
$data['goodList']['brand'] = $brandData['id'];
|
|
|
$data['goodList'] += ListProcess::getListData($listData['data']);
|
|
|
}
|
|
|
$listData = array();
|
|
|
}
|
|
|
// // 查询数据
|
|
|
// if (!isset($condition['query'])) {
|
|
|
// $data['goodList'] += Product\ListModel::getClassData($condition);
|
|
|
// } else {
|
|
|
// $listData = SearchData::searchByCondition($condition);
|
|
|
// // 处理返回的数据
|
|
|
// if (!empty($listData['data']['brand'])) {
|
|
|
// $brandData = $listData['data']['brand'];
|
|
|
// $data['brandWay'] = array(
|
|
|
// 'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
|
|
|
// 'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
|
|
|
// 'name' => $brandData['brand_name']
|
|
|
// );
|
|
|
// // 设置品牌默认值
|
|
|
// $data['goodList']['brand'] = $brandData['id'];
|
|
|
// $data['goodList'] += ListProcess::getListData($listData['data']);
|
|
|
// }
|
|
|
// $listData = array();
|
|
|
// }
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
...
|
...
|
|