Authored by xuqi

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -191,19 +191,19 @@ class HelperSearch
$isSale = false;
}
$gender = 0;
if (isset(self::$options['gender'])) {
$genderArr = explode(',', self::$options['gender']);
if (isset(self::$params['gender'])) {
$genderArr = explode(',', self::$params['gender']);
$gender = $genderArr[0];
}
foreach($val['goods_list'] as $k => $v){
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
//女封
if (isset($v['cover_1']) && $gender == 1) {
$val['default_images'] = $v['images_url'];
}
//男封
if (isset($v['cover_2']) && $gender == 2) {
$val['default_images'] = $v['images_url'];
if (isset($v['cover_1']) && !empty($v['cover_1']) && $gender == 1) {
$val['default_images'] = $v['cover_1'];
}
//女封
if (isset($v['cover_2']) && !empty($v['cover_2']) && $gender == 2) {
$val['default_images'] = $v['cover_2'];
}
//筛选符合颜色条件的封面图片
if (isset($params['color']) && $params['color'] == $v['color_id']) {
... ... @@ -232,6 +232,10 @@ class HelperSearch
'thumb' => $val['default_images'],
'name' => $val['product_name'],
'salePrice' => $val['sales_price'],
'brand' => array(
'url' => Helpers::url('', '', $val['brand_domain']),
'name' => $val['brand_name']
),
'isFew' => $isFew,
'skn' => $val['product_skn'],
'showColBtn' => true,
... ... @@ -492,7 +496,7 @@ class HelperSearch
$existName[] = $v['brand_name'];
}
if ($existBrandNum === 1){
$existName[]= substr($v['brand_name'], 0, 3).'...';
$existName[]= substr($v['brand_name'], 0, 4).'...';
}
$existBrandNum++;
}
... ... @@ -547,9 +551,30 @@ class HelperSearch
if (self::checkSearch('brand')) {
return array();
}
//品牌数量小于等于10,隐藏更多按钮
$result['showMulti'] = count($result['brandsShow']) > 1 ? true :false;
$result['showMore'] = count($result['brandsShow']) > 10 ? true :false;
//品牌数量等于1,设置为已选中
$totalBrand = count($result['brandsShow']);
if ($totalBrand == 1) {
if (!in_array($totalBrand, $brandIds)) {
//设置已选中
self::$selected['brand'] = array(
'name' => $result['brandsShow'][0]['name'],
'href' => self::buildUrl($params, array('brand', $result['brandsShow'][0]['href']))
);
$result['default'][0]['checked'] = true;
}
if (self::$options['controller'] == 'Search') {
return array();
}
}
//品牌数量大于1小于10,显示多选
elseif ($totalBrand > 1 && $totalBrand < 10) {
$result['showMulti'] = true;
}
//品牌数量大于10,显示多选、更多按钮
else {
$result['showMulti'] = true;
$result['showMore'] = true;
}
return $result;
}
/**
... ... @@ -1380,7 +1405,12 @@ class HelperSearch
$action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
//列表页面
if ($controller == 'list' && $action == 'index') {
$type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : '';
if (isset(self::$params['misort'])) {
$type = self::$params['misort'];
}
elseif (isset(self::$params['msort'])) {
$type = self::$params['msort'];
}
}
//新品到着
elseif ($controller == 'list' && $action == 'new') {
... ...
... ... @@ -120,7 +120,7 @@
}
.tpl-brands{
width: 378px;
height: 504px;
height: 512px;
li a{
height: 248px;
}
... ...
... ... @@ -21,7 +21,7 @@ class NewModel
// 组合搜索商品url
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']);
$urlList['sort'] = SearchData::getClassesUrl();
// 组合搜索最新上架url
$urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']);
... ...