Authored by 周少峰

无搜索结果提示不一致

... ... @@ -20,7 +20,7 @@ class HelperSearch
//总页数
public static $pageTotal;
//总记录数
public static $total;
public static $total = 0;
//接口返回搜索条件
public static $filter;
//选中的条件
... ... @@ -142,10 +142,6 @@ class HelperSearch
}
//选中条件
$result['filters']['checkedConditions'] = self::getSelected();
if (empty($result['goods'])) {
$result['filters'] = array();
$result['opts'] = array();
}
$result['pathNav'] = isset($options['controller']) && $options['controller'] == 'Sale' ? array() : self::$listNav;
return $result;
}
... ... @@ -680,10 +676,6 @@ class HelperSearch
public static function price($filter)
{
$result = array();
//商品记录小于10,不显示价格区间
if (self::$total < 10) {
return $result;
}
$params = self::$params;
$priceId = isset($params['price']) && !empty(self::$params['price']) ? self::$params['price'] : '';
if (isset($params['price'])) {
... ... @@ -707,6 +699,10 @@ class HelperSearch
'href' => self::buildUrl($params)
);
}
//商品记录小于10,不显示价格区间
if (self::$total < 10) {
return $result;
}
if (self::checkSearch('price')) {
return array();
}
... ... @@ -1086,6 +1082,10 @@ class HelperSearch
public static function getSelected()
{
$result = array();
//无结果
if (self::$total == 0 && self::$options['controller'] == 'Search') {
return $result;
}
$data = array();
foreach (self::$selected as $key => $val) {
$data[] = $val;
... ... @@ -1386,6 +1386,10 @@ class HelperSearch
*/
public static function getOpts()
{
//无结果
if (self::$total == 0 && self::$options['controller'] == 'Search') {
return array();
}
//排序方式
$result['sortType'] = array( self::orderDefault(),self::orderTime(),self::orderPrice(),self::orderDiscount());
//特殊:新品、特价、限量
... ...