Authored by Rock Zhang

修复各频道首页底部banner的banner报错的bug

... ... @@ -142,10 +142,10 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart($resource);
if (isset($banner['code']) && $banner['code'] == 200) {
if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) {
$result = array();
// 处理数据
foreach ($banner['data'] as $val) {
foreach ($banner['data']['list'] as $val) {
foreach ($val['data'] as $single) {
$result['url'] = ($channel === 2) ? Helpers::url('/boys') : Helpers::url('/girls');
$result['img'] = Helpers::getImageUrl($single['src'], 640, 200);
... ...