修复品牌一览顶部banner不显示的bug,接口数据格式变化导致
Showing
1 changed file
with
12 additions
and
0 deletions
@@ -84,6 +84,18 @@ class BrandModel | @@ -84,6 +84,18 @@ class BrandModel | ||
84 | $result['bannerTop']['list'][] = $build; | 84 | $result['bannerTop']['list'][] = $build; |
85 | } | 85 | } |
86 | } | 86 | } |
87 | + // 顶部的轮翻广告列表 | ||
88 | + elseif (!empty($brand['brandTop']['list'][0]['data'])) { | ||
89 | + $build = array(); | ||
90 | + foreach ($brand['brandTop']['list'][0]['data'] as $value) { | ||
91 | + if (isset($value['url'])) { | ||
92 | + $build['url'] = Helpers::getFilterUrl($value['url']); | ||
93 | + } | ||
94 | + $build['img'] = Helpers::getImageUrl($value['src'], 640, 310); | ||
95 | + $build['title'] = $value['title']; | ||
96 | + $result['bannerTop']['list'][] = $build; | ||
97 | + } | ||
98 | + } | ||
87 | 99 | ||
88 | /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */ | 100 | /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */ |
89 | if (!empty($brand['brandTop'][1]['data']['list'])) { | 101 | if (!empty($brand['brandTop'][1]['data']['list'])) { |
-
Please register or login to post a comment