|
@@ -319,7 +319,7 @@ class HelperSearch |
|
@@ -319,7 +319,7 @@ class HelperSearch |
319
|
}
|
319
|
}
|
320
|
}
|
320
|
}
|
321
|
$result['list'] = $sortList;
|
321
|
$result['list'] = $sortList;
|
322
|
-
|
322
|
+// print_r($result); exit;
|
323
|
return $result;
|
323
|
return $result;
|
324
|
}
|
324
|
}
|
325
|
|
325
|
|
|
@@ -427,13 +427,15 @@ class HelperSearch |
|
@@ -427,13 +427,15 @@ class HelperSearch |
427
|
unset($params['brand']);
|
427
|
unset($params['brand']);
|
428
|
//设置已选中的品牌
|
428
|
//设置已选中的品牌
|
429
|
foreach ($brandIds as $key => $val) {
|
429
|
foreach ($brandIds as $key => $val) {
|
430
|
- $brandParam = $brandIds;
|
|
|
431
|
- unset($brandParam[$key]);
|
|
|
432
|
- $params['brand'] = implode(',', $brandParam);
|
|
|
433
|
- self::$selected['brand'][] = array(
|
|
|
434
|
- 'name' => $brandAll[$val],
|
|
|
435
|
- 'href' => self::buildUrl($params)
|
|
|
436
|
- );
|
430
|
+ if (isset($brandAll[$val])) {
|
|
|
431
|
+ $brandParam = $brandIds;
|
|
|
432
|
+ unset($brandParam[$key]);
|
|
|
433
|
+ $params['brand'] = implode(',', $brandParam);
|
|
|
434
|
+ self::$selected['brand'][] = array(
|
|
|
435
|
+ 'name' => $brandAll[$val],
|
|
|
436
|
+ 'href' => self::buildUrl($params)
|
|
|
437
|
+ );
|
|
|
438
|
+ }
|
437
|
}
|
439
|
}
|
438
|
ksort($brandList);
|
440
|
ksort($brandList);
|
439
|
//品牌列表排序, 添加品牌索引
|
441
|
//品牌列表排序, 添加品牌索引
|
|
@@ -474,7 +476,7 @@ class HelperSearch |
|
@@ -474,7 +476,7 @@ class HelperSearch |
474
|
$result = array();
|
476
|
$result = array();
|
475
|
if (isset($filter['size']) && !empty($filter['size'])) {
|
477
|
if (isset($filter['size']) && !empty($filter['size'])) {
|
476
|
$size = $filter['size'];
|
478
|
$size = $filter['size'];
|
477
|
- foreach ($size as $v) {
|
479
|
+ foreach ($size as $k=> $v) {
|
478
|
//设置选中
|
480
|
//设置选中
|
479
|
if ($v['size_id'] == $sizeId) {
|
481
|
if ($v['size_id'] == $sizeId) {
|
480
|
self::$selected['size'] = array(
|
482
|
self::$selected['size'] = array(
|
|
@@ -482,12 +484,12 @@ class HelperSearch |
|
@@ -482,12 +484,12 @@ class HelperSearch |
482
|
'href' => self::buildUrl($params)
|
484
|
'href' => self::buildUrl($params)
|
483
|
);
|
485
|
);
|
484
|
}
|
486
|
}
|
485
|
-
|
|
|
486
|
$result[] = array(
|
487
|
$result[] = array(
|
487
|
'name' => $v['size_name'],
|
488
|
'name' => $v['size_name'],
|
488
|
'href' => self::buildUrl(array_merge($params, array(
|
489
|
'href' => self::buildUrl(array_merge($params, array(
|
489
|
'size' => $v['size_id']
|
490
|
'size' => $v['size_id']
|
490
|
))) ,
|
491
|
))) ,
|
|
|
492
|
+ 'checked' => isset(self::$params['size']) && self::$params['size'] == $v['size_id'] ? true : false
|
491
|
);
|
493
|
);
|
492
|
}
|
494
|
}
|
493
|
if (self::checkSearch('size')) {
|
495
|
if (self::checkSearch('size')) {
|
|
@@ -579,6 +581,7 @@ class HelperSearch |
|
@@ -579,6 +581,7 @@ class HelperSearch |
579
|
'href' => self::buildUrl(array_merge($params, array(
|
581
|
'href' => self::buildUrl(array_merge($params, array(
|
580
|
'price' => $key
|
582
|
'price' => $key
|
581
|
))) ,
|
583
|
))) ,
|
|
|
584
|
+ 'checked' => isset(self::$params['price']) && self::$params['price'] == $key ? true : false
|
582
|
);
|
585
|
);
|
583
|
}
|
586
|
}
|
584
|
return $result;
|
587
|
return $result;
|
|
@@ -1213,11 +1216,9 @@ class HelperSearch |
|
@@ -1213,11 +1216,9 @@ class HelperSearch |
1213
|
|
1216
|
|
1214
|
public static function getClassesUrl($condition)
|
1217
|
public static function getClassesUrl($condition)
|
1215
|
{
|
1218
|
{
|
1216
|
-
|
|
|
1217
|
$condition['sales'] = 'Y'; //在销售商品分类
|
1219
|
$condition['sales'] = 'Y'; //在销售商品分类
|
1218
|
$condition['status'] = 1; //上架商品分类
|
1220
|
$condition['status'] = 1; //上架商品分类
|
1219
|
$condition['stocknumber'] = 1; //过滤掉已售罄
|
1221
|
$condition['stocknumber'] = 1; //过滤掉已售罄
|
1220
|
-
|
|
|
1221
|
return Yohobuy::httpBuildQuery(self::getUrl('sort'), $condition);
|
1222
|
return Yohobuy::httpBuildQuery(self::getUrl('sort'), $condition);
|
1222
|
}
|
1223
|
}
|
1223
|
|
1224
|
|