Authored by xuqi

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

@@ -191,19 +191,19 @@ class HelperSearch @@ -191,19 +191,19 @@ class HelperSearch
191 $isSale = false; 191 $isSale = false;
192 } 192 }
193 $gender = 0; 193 $gender = 0;
194 - if (isset(self::$options['gender'])) {  
195 - $genderArr = explode(',', self::$options['gender']); 194 + if (isset(self::$params['gender'])) {
  195 + $genderArr = explode(',', self::$params['gender']);
196 $gender = $genderArr[0]; 196 $gender = $genderArr[0];
197 } 197 }
198 foreach($val['goods_list'] as $k => $v){ 198 foreach($val['goods_list'] as $k => $v){
199 $goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']); 199 $goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
200 - //女封  
201 - if (isset($v['cover_1']) && $gender == 1) {  
202 - $val['default_images'] = $v['images_url'];  
203 - }  
204 //男封 200 //男封
205 - if (isset($v['cover_2']) && $gender == 2) {  
206 - $val['default_images'] = $v['images_url']; 201 + if (isset($v['cover_1']) && !empty($v['cover_1']) && $gender == 1) {
  202 + $val['default_images'] = $v['cover_1'];
  203 + }
  204 + //女封
  205 + if (isset($v['cover_2']) && !empty($v['cover_2']) && $gender == 2) {
  206 + $val['default_images'] = $v['cover_2'];
207 } 207 }
208 //筛选符合颜色条件的封面图片 208 //筛选符合颜色条件的封面图片
209 if (isset($params['color']) && $params['color'] == $v['color_id']) { 209 if (isset($params['color']) && $params['color'] == $v['color_id']) {
@@ -232,6 +232,10 @@ class HelperSearch @@ -232,6 +232,10 @@ class HelperSearch
232 'thumb' => $val['default_images'], 232 'thumb' => $val['default_images'],
233 'name' => $val['product_name'], 233 'name' => $val['product_name'],
234 'salePrice' => $val['sales_price'], 234 'salePrice' => $val['sales_price'],
  235 + 'brand' => array(
  236 + 'url' => Helpers::url('', '', $val['brand_domain']),
  237 + 'name' => $val['brand_name']
  238 + ),
235 'isFew' => $isFew, 239 'isFew' => $isFew,
236 'skn' => $val['product_skn'], 240 'skn' => $val['product_skn'],
237 'showColBtn' => true, 241 'showColBtn' => true,
@@ -492,7 +496,7 @@ class HelperSearch @@ -492,7 +496,7 @@ class HelperSearch
492 $existName[] = $v['brand_name']; 496 $existName[] = $v['brand_name'];
493 } 497 }
494 if ($existBrandNum === 1){ 498 if ($existBrandNum === 1){
495 - $existName[]= substr($v['brand_name'], 0, 3).'...'; 499 + $existName[]= substr($v['brand_name'], 0, 4).'...';
496 } 500 }
497 $existBrandNum++; 501 $existBrandNum++;
498 } 502 }
@@ -547,9 +551,30 @@ class HelperSearch @@ -547,9 +551,30 @@ class HelperSearch
547 if (self::checkSearch('brand')) { 551 if (self::checkSearch('brand')) {
548 return array(); 552 return array();
549 } 553 }
550 - //品牌数量小于等于10,隐藏更多按钮  
551 - $result['showMulti'] = count($result['brandsShow']) > 1 ? true :false;  
552 - $result['showMore'] = count($result['brandsShow']) > 10 ? true :false; 554 + //品牌数量等于1,设置为已选中
  555 + $totalBrand = count($result['brandsShow']);
  556 + if ($totalBrand == 1) {
  557 + if (!in_array($totalBrand, $brandIds)) {
  558 + //设置已选中
  559 + self::$selected['brand'] = array(
  560 + 'name' => $result['brandsShow'][0]['name'],
  561 + 'href' => self::buildUrl($params, array('brand', $result['brandsShow'][0]['href']))
  562 + );
  563 + $result['default'][0]['checked'] = true;
  564 + }
  565 + if (self::$options['controller'] == 'Search') {
  566 + return array();
  567 + }
  568 + }
  569 + //品牌数量大于1小于10,显示多选
  570 + elseif ($totalBrand > 1 && $totalBrand < 10) {
  571 + $result['showMulti'] = true;
  572 + }
  573 + //品牌数量大于10,显示多选、更多按钮
  574 + else {
  575 + $result['showMulti'] = true;
  576 + $result['showMore'] = true;
  577 + }
553 return $result; 578 return $result;
554 } 579 }
555 /** 580 /**
@@ -1380,7 +1405,12 @@ class HelperSearch @@ -1380,7 +1405,12 @@ class HelperSearch
1380 $action = isset(self::$options['action']) ? strtolower(self::$options['action']) : ''; 1405 $action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
1381 //列表页面 1406 //列表页面
1382 if ($controller == 'list' && $action == 'index') { 1407 if ($controller == 'list' && $action == 'index') {
1383 - $type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : ''; 1408 + if (isset(self::$params['misort'])) {
  1409 + $type = self::$params['misort'];
  1410 + }
  1411 + elseif (isset(self::$params['msort'])) {
  1412 + $type = self::$params['msort'];
  1413 + }
1384 } 1414 }
1385 //新品到着 1415 //新品到着
1386 elseif ($controller == 'list' && $action == 'new') { 1416 elseif ($controller == 'list' && $action == 'new') {
@@ -120,7 +120,7 @@ @@ -120,7 +120,7 @@
120 } 120 }
121 .tpl-brands{ 121 .tpl-brands{
122 width: 378px; 122 width: 378px;
123 - height: 504px; 123 + height: 512px;
124 li a{ 124 li a{
125 height: 248px; 125 height: 248px;
126 } 126 }
@@ -21,7 +21,7 @@ class NewModel @@ -21,7 +21,7 @@ class NewModel
21 // 组合搜索商品url 21 // 组合搜索商品url
22 $urlList['product'] = SearchData::getProductUrl($searchCondition['condition']); 22 $urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
23 // 组合搜索分类url 23 // 组合搜索分类url
24 - $urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']); 24 + $urlList['sort'] = SearchData::getClassesUrl();
25 // 组合搜索最新上架url 25 // 组合搜索最新上架url
26 $urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']); 26 $urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']);
27 27