Authored by 郝肖肖

brand_id 未返回变量判断

@@ -1446,9 +1446,14 @@ class HelperSearch @@ -1446,9 +1446,14 @@ class HelperSearch
1446 public static function shop($shop, $shopSort) 1446 public static function shop($shop, $shopSort)
1447 { 1447 {
1448 $shopEntry = array(); 1448 $shopEntry = array();
1449 - if (self::$total == 0 || empty($shopSort)) { 1449 + if (self::$total == 0) {
1450 return $shopEntry; 1450 return $shopEntry;
1451 } 1451 }
  1452 +
  1453 + if (empty($shopSort)) {
  1454 + $shopSort = array();
  1455 + }
  1456 +
1452 $shop['shop_id'] = empty($shop['shop_id']) ? '' : $shop['shop_id']; 1457 $shop['shop_id'] = empty($shop['shop_id']) ? '' : $shop['shop_id'];
1453 1458
1454 $url = Helpers::url('', array('shopId' => $shop['shop_id']), $shop['brand_domain']); 1459 $url = Helpers::url('', array('shopId' => $shop['shop_id']), $shop['brand_domain']);
@@ -241,10 +241,13 @@ class SearchModel @@ -241,10 +241,13 @@ class SearchModel
241 if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) { 241 if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) {
242 //多品店 店铺入口 242 //多品店 店铺入口
243 foreach ($shopsByBrands['data'] as $val) { 243 foreach ($shopsByBrands['data'] as $val) {
244 - $shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));  
245 - if (isset($shopSort['code']) && $shopSort['code'] == 200) {  
246 - $data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']); 244 + if (isset($val['brand_id'])) {
  245 + $shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));
247 } 246 }
  247 + $data['shopData'][] = array(
  248 + 'shop' => $val,
  249 + 'shopSort' => empty($shopSort['data']['sort']) ? array() : $shopSort['data']['sort']
  250 + );
248 } 251 }
249 } else { 252 } else {
250 //品牌入口 253 //品牌入口