Authored by 郝肖肖

多品店 搜索

@@ -180,7 +180,6 @@ class HelperSearch @@ -180,7 +180,6 @@ class HelperSearch
180 if (isset($data['shopData']) && !empty($data['shopData'])) { 180 if (isset($data['shopData']) && !empty($data['shopData'])) {
181 $result['shopEntry'] = array(); 181 $result['shopEntry'] = array();
182 foreach ($data['shopData'] as $val) { 182 foreach ($data['shopData'] as $val) {
183 - $val['shop']['shop_id'] = empty($val['shop']['shop_id']) ? '' : $val['shop']['shop_id'];  
184 $shopSort = self::shop($val['shop'], $val['shopSort']); 183 $shopSort = self::shop($val['shop'], $val['shopSort']);
185 if (empty($shopSort)) { 184 if (empty($shopSort)) {
186 continue; 185 continue;
@@ -1450,6 +1449,8 @@ class HelperSearch @@ -1450,6 +1449,8 @@ class HelperSearch
1450 if (self::$total == 0 || empty($shopSort)) { 1449 if (self::$total == 0 || empty($shopSort)) {
1451 return $shopEntry; 1450 return $shopEntry;
1452 } 1451 }
  1452 + $shop['shop_id'] = empty($shop['shop_id']) ? '' : $shop['shop_id'];
  1453 +
1453 $url = Helpers::url('', array('shopId' => $shop['shop_id']), $shop['brand_domain']); 1454 $url = Helpers::url('', array('shopId' => $shop['shop_id']), $shop['brand_domain']);
1454 $sort = array(); 1455 $sort = array();
1455 $sortInfo = array(); 1456 $sortInfo = array();
@@ -1462,7 +1463,7 @@ class HelperSearch @@ -1462,7 +1463,7 @@ class HelperSearch
1462 break 2; 1463 break 2;
1463 } 1464 }
1464 $sortInfo = array(); 1465 $sortInfo = array();
1465 - $sortInfo['href'] = "{$url}/?msort={$msort['sort_id']}&misort={$misort['sort_id']}&shopId={$shop['shop_id']}"; 1466 + $sortInfo['href'] = "{$url}&msort={$msort['sort_id']}&misort={$misort['sort_id']}";
1466 $sortInfo['name'] = $misort['sort_name']; 1467 $sortInfo['name'] = $misort['sort_name'];
1467 $sort[] = $sortInfo; 1468 $sort[] = $sortInfo;
1468 } 1469 }
@@ -239,12 +239,19 @@ class SearchModel @@ -239,12 +239,19 @@ class SearchModel
239 $data['shopData'] = array(); 239 $data['shopData'] = array();
240 $shopsByBrands = SearchData::getQueryShopsByBrandId($data['shop']['id']); 240 $shopsByBrands = SearchData::getQueryShopsByBrandId($data['shop']['id']);
241 if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) { 241 if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) {
  242 + //多品店 店铺入口
242 foreach ($shopsByBrands['data'] as $val) { 243 foreach ($shopsByBrands['data'] as $val) {
243 $shopSort = SearchData::getClassesData(array('brand' => $val['brand_id'])); 244 $shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));
244 if (isset($shopSort['code']) && $shopSort['code'] == 200) { 245 if (isset($shopSort['code']) && $shopSort['code'] == 200) {
245 $data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']); 246 $data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']);
246 } 247 }
247 } 248 }
  249 + } else {
  250 + //品牌入口
  251 + $shopSort = SearchData::getClassesData(array('brand' => $data['shop']['id']));
  252 + if (isset($shopSort['code']) && $shopSort['code'] == 200) {
  253 + $data['shopData'][] = array('shop' => $data['shop'], 'shopSort' => $shopSort['data']['sort']);
  254 + }
248 } 255 }
249 } 256 }
250 // 组织模板数据 257 // 组织模板数据