...
|
...
|
@@ -59,19 +59,19 @@ class HelperSearch |
|
|
self::$options = $options;
|
|
|
unset(self::$params['/']);
|
|
|
unset(self::$params['page']);
|
|
|
self::$filter = $data['product']['filter'];
|
|
|
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
|
|
|
//产品列表
|
|
|
$result['goods'] = self::getProductList($data['product']['product_list'], $options['imgSize']);
|
|
|
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
|
|
|
//总页数
|
|
|
$result['page_total'] = $data['product']['page_total'];
|
|
|
self::$pageTotal = $data['product']['page_total'];
|
|
|
$result['page_total'] = isset($data['product']['page_total']) ? $data['product']['page_total'] : '';
|
|
|
self::$pageTotal = $result['page_total'];
|
|
|
//当前页
|
|
|
$result['page'] = $data['product']['page'];
|
|
|
$result['page'] = isset($data['product']['page']) ? $data['product']['page'] : '';
|
|
|
self::$page = $result['page'];
|
|
|
//筛选条件
|
|
|
$result['filters'] = self::filter();
|
|
|
$result['filters'] = isset($data['product']['filter']) ? self::filter() : array();
|
|
|
//排序方式、显示数量等其他选项
|
|
|
$result['opts'] = self::getOpts();
|
|
|
$result['opts'] = isset($data['product']['filter']) ? self::getOpts() : array();
|
|
|
//下一页
|
|
|
$result['hasNextPage'] = self::next($data['product']['page_total']);
|
|
|
//全部折扣
|
...
|
...
|
@@ -361,7 +361,6 @@ class HelperSearch |
|
|
$brandIds = isset($params['brand']) && !empty($params['brand']) ? explode(',', $params['brand']) : array();
|
|
|
if (isset($filter['brand']) && !empty($filter['brand'])) {
|
|
|
$brand = $filter['brand'];
|
|
|
// print_r($filter); exit;
|
|
|
//已选中品牌数量
|
|
|
$existBrandNum = 0;
|
|
|
//已选中品牌标签名
|
...
|
...
|
@@ -427,15 +426,20 @@ class HelperSearch |
|
|
if ($key && !in_array($key, $index_key) && !is_numeric($key)) {
|
|
|
$index['index'] = strtolower(($key));
|
|
|
$index['name'] = $key;
|
|
|
$result['brandIndex'][] = $index;
|
|
|
$index_key[] = $index;
|
|
|
}
|
|
|
if ($key && !in_array($key, $index_key) && is_numeric($key) && count($result['brandIndex']) === 1) {
|
|
|
$index['index'] = '0-9';
|
|
|
$index['name'] = '0~9';
|
|
|
$result['brandIndex'][] = $index;
|
|
|
}
|
|
|
if (is_array($val)) {
|
|
|
foreach ($val as $v) {
|
|
|
$result['brandsShow'][] = $v;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$result['brandIndex'] = array_merge($result['brandIndex'], $index_key);
|
|
|
unset($brandList);
|
|
|
}
|
|
|
//搜索页已选中,返回空
|
...
|
...
|
|