|
@@ -3,7 +3,6 @@ namespace Product; |
|
@@ -3,7 +3,6 @@ namespace Product; |
3
|
|
3
|
|
4
|
use Plugin\Helpers;
|
4
|
use Plugin\Helpers;
|
5
|
use LibModels\Web\Product\BrandData;
|
5
|
use LibModels\Web\Product\BrandData;
|
6
|
-use Product\SearchModel;
|
|
|
7
|
|
6
|
|
8
|
/**
|
7
|
/**
|
9
|
* Description of Brands
|
8
|
* Description of Brands
|
|
@@ -13,9 +12,10 @@ use Product\SearchModel; |
|
@@ -13,9 +12,10 @@ use Product\SearchModel; |
13
|
class BrandsModel
|
12
|
class BrandsModel
|
14
|
{
|
13
|
{
|
15
|
|
14
|
|
16
|
- const URL_BRAND_INDEX = '/product/brands/index';
|
15
|
+ const URL_BRAND_INDEX = '/product/index/brand';
|
17
|
|
16
|
|
18
|
public static $shopName;
|
17
|
public static $shopName;
|
|
|
18
|
+ public static $home;
|
19
|
/**
|
19
|
/**
|
20
|
* 获取品牌首页banner条
|
20
|
* 获取品牌首页banner条
|
21
|
* @string $domain 品牌域名
|
21
|
* @string $domain 品牌域名
|
|
@@ -27,7 +27,7 @@ class BrandsModel |
|
@@ -27,7 +27,7 @@ class BrandsModel |
27
|
public static function getBannerByDomain($domain, $bannerId, $uid = '')
|
27
|
public static function getBannerByDomain($domain, $bannerId, $uid = '')
|
28
|
{
|
28
|
{
|
29
|
// 构造品牌主页url
|
29
|
// 构造品牌主页url
|
30
|
- $home = Helpers::url('', '', $domain) . self::URL_BRAND_INDEX;
|
30
|
+ self::$home = Helpers::url('', '', $domain) . self::URL_BRAND_INDEX;
|
31
|
// 根据品牌Id获取品牌banner图
|
31
|
// 根据品牌Id获取品牌banner图
|
32
|
$bannerImg = BrandData::getBrandBanner($bannerId);
|
32
|
$bannerImg = BrandData::getBrandBanner($bannerId);
|
33
|
if (isset($bannerImg['data'])) {
|
33
|
if (isset($bannerImg['data'])) {
|
|
@@ -66,7 +66,7 @@ class BrandsModel |
|
@@ -66,7 +66,7 @@ class BrandsModel |
66
|
'banner' => $bannerImg
|
66
|
'banner' => $bannerImg
|
67
|
),
|
67
|
),
|
68
|
'shopEntry' => array(
|
68
|
'shopEntry' => array(
|
69
|
- 'home' => $home,
|
69
|
+ 'home' => self::$home,
|
70
|
'logo' => $logo,
|
70
|
'logo' => $logo,
|
71
|
'shopName' => self::$shopName,
|
71
|
'shopName' => self::$shopName,
|
72
|
'sort' => array(
|
72
|
'sort' => array(
|
|
@@ -99,6 +99,15 @@ class BrandsModel |
|
@@ -99,6 +99,15 @@ class BrandsModel |
99
|
$classes['brand'] = $condition['brand'];
|
99
|
$classes['brand'] = $condition['brand'];
|
100
|
// 调用商品搜索接口
|
100
|
// 调用商品搜索接口
|
101
|
$data = \Product\SearchModel::getSearchData($condition, $options,$classes);
|
101
|
$data = \Product\SearchModel::getSearchData($condition, $options,$classes);
|
|
|
102
|
+ $advNav = BrandData::getFolderByBrand($condition['brand'],1);
|
|
|
103
|
+ $result = array();
|
|
|
104
|
+ if (isset($advNav['data']) && $advNav['code'] === 200) {
|
|
|
105
|
+ foreach ($advNav['data'] as $key => $value) {
|
|
|
106
|
+ $result['list'][$key]['href'] = self::$home . '?folder=' . $value['id'];
|
|
|
107
|
+ $result['list'][$key]['src'] = $value['brand_sort_ico'];
|
|
|
108
|
+ }
|
|
|
109
|
+ }
|
|
|
110
|
+ $data['list']['advNav'] = $result;
|
102
|
$shopName = self::$shopName;
|
111
|
$shopName = self::$shopName;
|
103
|
if(isset($data['list'])){
|
112
|
if(isset($data['list'])){
|
104
|
$arr = array_chunk($data['list']['pathNav'],1);
|
113
|
$arr = array_chunk($data['list']['pathNav'],1);
|
|
@@ -107,6 +116,7 @@ class BrandsModel |
|
@@ -107,6 +116,7 @@ class BrandsModel |
107
|
);
|
116
|
);
|
108
|
}
|
117
|
}
|
109
|
$nav = array_merge_recursive($arr[0],$arr[1]);
|
118
|
$nav = array_merge_recursive($arr[0],$arr[1]);
|
|
|
119
|
+
|
110
|
$data['list']['pathNav'] = $nav;
|
120
|
$data['list']['pathNav'] = $nav;
|
111
|
//删除品牌列表
|
121
|
//删除品牌列表
|
112
|
unset($data['list']['filters']['brand']);
|
122
|
unset($data['list']['filters']['brand']);
|