Authored by Rock Zhang

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

Code Review By Rock Zhang
... ... @@ -142,10 +142,10 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart($resource);
if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) {
if (isset($banner['code']) && $banner['code'] == 200 && !empty($banner['data'])) {
$result = array();
// 处理数据
foreach ($banner['data']['list'] as $val) {
foreach ($banner['data'] 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);
... ...