|
@@ -60,8 +60,18 @@ class BrandModel |
|
@@ -60,8 +60,18 @@ class BrandModel |
60
|
// 搜索链接地址
|
60
|
// 搜索链接地址
|
61
|
$result['searchUrl'] = Helpers::url('/brands/search', null);
|
61
|
$result['searchUrl'] = Helpers::url('/brands/search', null);
|
62
|
|
62
|
|
63
|
- /* 顶部的轮翻广告列表 */
|
|
|
64
|
- if (!empty($brand['brandTop'][0]['data'])) {
|
63
|
+ /* 顶部的轮翻广告或热门品牌列表(当没有轮翻广告的情况下会是这个样子的! 此处是根据接口改造成的逻辑) */
|
|
|
64
|
+ if (!empty($brand['brandTop'][0]['data']['list'])) {
|
|
|
65
|
+ $build = array();
|
|
|
66
|
+ foreach ($brand['brandTop'][0]['data']['list'] as $value) {
|
|
|
67
|
+ $build['url'] = Helpers::getFilterUrl($value['url']);
|
|
|
68
|
+ $build['img'] = Helpers::getImageUrl($value['src'], 144, 144);
|
|
|
69
|
+ $build['name'] = $value['name'];
|
|
|
70
|
+ $result['hotBrand']['list'][] = $build;
|
|
|
71
|
+ }
|
|
|
72
|
+ }
|
|
|
73
|
+ // 顶部的轮翻广告列表
|
|
|
74
|
+ elseif (!empty($brand['brandTop'][0]['data'])) {
|
65
|
$build = array();
|
75
|
$build = array();
|
66
|
foreach ($brand['brandTop'][0]['data'] as $value) {
|
76
|
foreach ($brand['brandTop'][0]['data'] as $value) {
|
67
|
$build['url'] = Helpers::getFilterUrl($value['url']);
|
77
|
$build['url'] = Helpers::getFilterUrl($value['url']);
|
|
@@ -71,7 +81,7 @@ class BrandModel |
|
@@ -71,7 +81,7 @@ class BrandModel |
71
|
}
|
81
|
}
|
72
|
}
|
82
|
}
|
73
|
|
83
|
|
74
|
- /* 顶部的热门品牌列表 */
|
84
|
+ /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
|
75
|
if (!empty($brand['brandTop'][1]['data']['list'])) {
|
85
|
if (!empty($brand['brandTop'][1]['data']['list'])) {
|
76
|
$build = array();
|
86
|
$build = array();
|
77
|
foreach ($brand['brandTop'][1]['data']['list'] as $value) {
|
87
|
foreach ($brand['brandTop'][1]['data']['list'] as $value) {
|