Authored by Rock Zhang

修复new和sale顶部banner获取错误的bug

@@ -184,12 +184,12 @@ class NewsaleModel @@ -184,12 +184,12 @@ class NewsaleModel
184 $newsale = NewsaleData::getNewsaleFocus($codeKey); 184 $newsale = NewsaleData::getNewsaleFocus($codeKey);
185 185
186 // 调用接口获取数据并封装 186 // 调用接口获取数据并封装
187 - if (isset($newsale['code']) && isset($newsale['data']['list'])) {  
188 - if(count($newsale['data']['list']) === 1) { 187 + if (isset($newsale['code']) && isset($newsale['data']['list']) && !empty($newsale['data']['list'])) {
  188 + if(count($newsale['data']['list'][0]['data']) === 1) {
189 $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240); 189 $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
190 } else { 190 } else {
191 - foreach ($newsale['data']['list'] as $one) {  
192 - $result['list'][] = Helpers::formatBanner($one['data'], 640, 240); 191 + foreach ($newsale['data']['list'][0]['data'] as $one) {
  192 + $result['list'][] = Helpers::formatBanner($one, 640, 240);
193 } 193 }
194 } 194 }
195 } 195 }