Authored by Rock Zhang

修复品牌一览页面楼层数据处理错误的bug

... ... @@ -9,25 +9,17 @@
</div>
</div>
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{# topData}}
{{! 头部banner}}
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{# hotBrand}}
<div class="hot-brand">
<ul class="hot-brand-list clearfix">
{{# list}}
<li>
<a href="{{url}}">
<div class="img-box">
<img class="lazy" data-original="{{img}}" alt="">
</div>
</a>
</li>
{{/ list}}
</ul>
</div>
{{/ hotBrand}}
{{! 热门品牌可滑动}}
{{# hotBrandsScroll}}
{{> home/hot_brands_swipe}}
{{/ hotBrandsScroll}}
{{/ topData}}
{{# brandList}}
<div class="brand-list bar-{{@index}}">
... ...
... ... @@ -3,6 +3,7 @@
namespace Category;
use LibModels\Wap\Category\BrandData;
use Plugin\DataProcess\FloorProcess;
use Plugin\Helpers;
/**
... ... @@ -60,55 +61,8 @@ class BrandModel
// 搜索链接地址
$result['searchUrl'] = Helpers::url('/brands/search', null);
/* 顶部的轮翻广告或热门品牌列表(当没有轮翻广告的情况下会是这个样子的! 此处是根据接口改造成的逻辑) */
if (!empty($brand['brandTop'][0]['data']['list'])) {
$build = array();
foreach ($brand['brandTop'][0]['data']['list'] as $value) {
if (isset($value['url'])) {
$build['url'] = Helpers::getFilterUrl($value['url']);
}
$build['img'] = Helpers::getImageUrl($value['src'], 144, 144);
$build['name'] = $value['name'];
$result['hotBrand']['list'][] = $build;
}
}
// 顶部的轮翻广告列表
elseif (!empty($brand['brandTop'][0]['data'])) {
$build = array();
foreach ($brand['brandTop'][0]['data'] as $value) {
if (isset($value['url'])) {
$build['url'] = Helpers::getFilterUrl($value['url']);
}
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$build['title'] = $value['title'];
$result['bannerTop']['list'][] = $build;
}
}
// 顶部的轮翻广告列表
elseif (!empty($brand['brandTop']['list'][0]['data'])) {
$build = array();
foreach ($brand['brandTop']['list'][0]['data'] as $value) {
if (isset($value['url'])) {
$build['url'] = Helpers::getFilterUrl($value['url']);
}
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$build['title'] = $value['title'];
$result['bannerTop']['list'][] = $build;
}
}
/* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
if (!empty($brand['brandTop'][1]['data']['list'])) {
$build = array();
foreach ($brand['brandTop'][1]['data']['list'] as $value) {
if (isset($value['url'])) {
$build['url'] = Helpers::getFilterUrl($value['url']);
}
$build['img'] = Helpers::getImageUrl($value['src'], 144, 144);
$build['name'] = $value['name'];
$result['hotBrand']['list'][] = $build;
}
}
// 资源位处理
$result['topData'] = FloorProcess::getContent($brand['brandTop'], $channel);
/* 按字母'A-Z'分组的品牌列表 */
if (!empty($brand['brandList']['brands'])) {
... ...