|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
// use LibModels\Wap\Product\SearchData;
|
|
|
// use Plugin\DataProcess\ListProcess;
|
|
|
use LibModels\Wap\Product\SearchData;
|
|
|
use Plugin\DataProcess\ListProcess;
|
|
|
use Plugin\Helpers;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -39,6 +39,7 @@ class SearchController extends AbstractAction |
|
|
'shop' => FILTER_DEFAULT,
|
|
|
'categoryId' => FILTER_DEFAULT,
|
|
|
'subCategoryId' => FILTER_DEFAULT,
|
|
|
'title' => FILTER_DEFAULT,
|
|
|
'query' => FILTER_DEFAULT,
|
|
|
'brand' => FILTER_DEFAULT,
|
|
|
'sort' => FILTER_DEFAULT,
|
...
|
...
|
@@ -106,9 +107,9 @@ class SearchController extends AbstractAction |
|
|
// 跳转到品牌商品列表页
|
|
|
if ($domain !== null) {
|
|
|
$url = Helpers::url('', array(
|
|
|
'from' => 'search',
|
|
|
'query' => $query
|
|
|
), $domain);
|
|
|
'from' => 'search',
|
|
|
'query' => $query
|
|
|
), $domain);
|
|
|
$this->go($url);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -122,7 +123,7 @@ class SearchController extends AbstractAction |
|
|
if (empty($classNames)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
|
|
|
/* 精确查一级品类 */
|
|
|
$sorts = array_keys($classNames['first'], $query, true);
|
|
|
if (isset($sorts[0])) {
|
...
|
...
|
@@ -151,13 +152,11 @@ class SearchController extends AbstractAction |
|
|
if ($isQueryFirstClass) {
|
|
|
$this->setTitle('全部' . $query);
|
|
|
$this->setNavHeader('全部' . $query, true, SITE_MAIN);
|
|
|
}
|
|
|
// 搜索是二级品类
|
|
|
} // 搜索是二级品类
|
|
|
elseif ($isQuerySecondClass) {
|
|
|
$this->setTitle($query);
|
|
|
$this->setNavHeader($query, true, SITE_MAIN);
|
|
|
}
|
|
|
// 搜索其它内容
|
|
|
} // 搜索其它内容
|
|
|
else {
|
|
|
$from = $this->get('from');
|
|
|
if ($haveQuery || $from) {
|
...
|
...
|
@@ -196,6 +195,11 @@ class SearchController extends AbstractAction |
|
|
$listData = array();
|
|
|
}
|
|
|
|
|
|
if($condition['title']){
|
|
|
$this->setTitle($condition['title']);
|
|
|
$this->setNavHeader($condition['title'], true, SITE_MAIN);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -254,8 +258,7 @@ class SearchController extends AbstractAction |
|
|
// 为了兼容现在运营在用的p_d
|
|
|
if (isset($condition['p_d'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['p_d']);
|
|
|
}
|
|
|
// 转换折扣
|
|
|
} // 转换折扣
|
|
|
elseif (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
unset($condition['discount']);
|
...
|
...
|
@@ -345,8 +348,7 @@ class SearchController extends AbstractAction |
|
|
// 为了兼容现在运营在用的p_d
|
|
|
if (isset($condition['p_d'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['p_d']);
|
|
|
}
|
|
|
// 转换折扣
|
|
|
} // 转换折扣
|
|
|
elseif (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
unset($condition['discount']);
|
...
|
...
|
|