Authored by 周少峰

修复bug

... ... @@ -319,7 +319,7 @@ class HelperSearch
}
}
$result['list'] = $sortList;
// print_r($result); exit;
return $result;
}
... ... @@ -427,6 +427,7 @@ class HelperSearch
unset($params['brand']);
//设置已选中的品牌
foreach ($brandIds as $key => $val) {
if (isset($brandAll[$val])) {
$brandParam = $brandIds;
unset($brandParam[$key]);
$params['brand'] = implode(',', $brandParam);
... ... @@ -435,6 +436,7 @@ class HelperSearch
'href' => self::buildUrl($params)
);
}
}
ksort($brandList);
//品牌列表排序, 添加品牌索引
$index_key = array();
... ... @@ -474,7 +476,7 @@ class HelperSearch
$result = array();
if (isset($filter['size']) && !empty($filter['size'])) {
$size = $filter['size'];
foreach ($size as $v) {
foreach ($size as $k=> $v) {
//设置选中
if ($v['size_id'] == $sizeId) {
self::$selected['size'] = array(
... ... @@ -482,12 +484,12 @@ class HelperSearch
'href' => self::buildUrl($params)
);
}
$result[] = array(
'name' => $v['size_name'],
'href' => self::buildUrl(array_merge($params, array(
'size' => $v['size_id']
))) ,
'checked' => isset(self::$params['size']) && self::$params['size'] == $v['size_id'] ? true : false
);
}
if (self::checkSearch('size')) {
... ... @@ -579,6 +581,7 @@ class HelperSearch
'href' => self::buildUrl(array_merge($params, array(
'price' => $key
))) ,
'checked' => isset(self::$params['price']) && self::$params['price'] == $key ? true : false
);
}
return $result;
... ... @@ -1213,11 +1216,9 @@ class HelperSearch
public static function getClassesUrl($condition)
{
$condition['sales'] = 'Y'; //在销售商品分类
$condition['status'] = 1; //上架商品分类
$condition['stocknumber'] = 1; //过滤掉已售罄
return Yohobuy::httpBuildQuery(self::getUrl('sort'), $condition);
}
... ...
... ... @@ -118,7 +118,16 @@ class SearchModel
$condition['viewNum'] = $condition['viewNum'] - 1;
$condition = array_merge($condition, $param);
$options = array_merge($options, $option);
//调用商品分类的参数
$sortCondition = $condition;
if (isset($sortCondition['msort'])) {
unset($sortCondition['msort']);
}
if (isset($sortCondition['misort'])) {
unset($sortCondition['misort']);
}
$data['condition'] = $condition;
$data['sortCondition'] = $sortCondition;
$data['options'] = $options;
return $data;
... ... @@ -137,7 +146,7 @@ class SearchModel
// 组合搜索商品url
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['sortCondition']);
// 组合搜索折扣区间url
$urlList['discount'] = HelperSearch::getDiscountUrl($searchCondition['condition']);
// 组合搜索最新上架url
... ... @@ -164,6 +173,12 @@ class SearchModel
// 组合搜索商品url
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
if (isset($condition['msort'])) {
unset($condition['msort']);
}
if (isset($condition['misort'])) {
unset($condition['misort']);
}
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
// 组合搜索店铺url
if (isset($param['keyword'])) {
... ...