Authored by 郝肖肖

多品店 搜索

... ... @@ -180,7 +180,6 @@ class HelperSearch
if (isset($data['shopData']) && !empty($data['shopData'])) {
$result['shopEntry'] = array();
foreach ($data['shopData'] as $val) {
$val['shop']['shop_id'] = empty($val['shop']['shop_id']) ? '' : $val['shop']['shop_id'];
$shopSort = self::shop($val['shop'], $val['shopSort']);
if (empty($shopSort)) {
continue;
... ... @@ -1450,6 +1449,8 @@ class HelperSearch
if (self::$total == 0 || empty($shopSort)) {
return $shopEntry;
}
$shop['shop_id'] = empty($shop['shop_id']) ? '' : $shop['shop_id'];
$url = Helpers::url('', array('shopId' => $shop['shop_id']), $shop['brand_domain']);
$sort = array();
$sortInfo = array();
... ... @@ -1462,7 +1463,7 @@ class HelperSearch
break 2;
}
$sortInfo = array();
$sortInfo['href'] = "{$url}/?msort={$msort['sort_id']}&misort={$misort['sort_id']}&shopId={$shop['shop_id']}";
$sortInfo['href'] = "{$url}&msort={$msort['sort_id']}&misort={$misort['sort_id']}";
$sortInfo['name'] = $misort['sort_name'];
$sort[] = $sortInfo;
}
... ...
... ... @@ -239,12 +239,19 @@ class SearchModel
$data['shopData'] = array();
$shopsByBrands = SearchData::getQueryShopsByBrandId($data['shop']['id']);
if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) {
//多品店 店铺入口
foreach ($shopsByBrands['data'] as $val) {
$shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));
if (isset($shopSort['code']) && $shopSort['code'] == 200) {
$data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']);
}
}
} else {
//品牌入口
$shopSort = SearchData::getClassesData(array('brand' => $data['shop']['id']));
if (isset($shopSort['code']) && $shopSort['code'] == 200) {
$data['shopData'][] = array('shop' => $data['shop'], 'shopSort' => $shopSort['data']['sort']);
}
}
}
// 组织模板数据
... ...