Authored by Rock Zhang

修复新品到着顶部banner图的bug

1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="newarrival-page yoho-page"> 2 <div class="newarrival-page yoho-page">
3 {{# headerBanner}} 3 {{# headerBanner}}
4 - {{> product/banner_swipe_and_single}} 4 + {{> product/banner-swipe-and-single}}
5 {{/ headerBanner}} 5 {{/ headerBanner}}
6 6
7 <ul id="list-nav" class="list-nav clearfix"> 7 <ul id="list-nav" class="list-nav clearfix">
@@ -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'][0]['data'])) {  
188 - if(count($newsale['data'][0]['data']) === 1) {  
189 - $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240); 187 + if (isset($newsale['code']) && isset($newsale['data']['list'])) {
  188 + if(count($newsale['data']['list']) === 1) {
  189 + $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
190 } else { 190 } else {
191 - foreach ($newsale['data'][0]['data'] as $one) {  
192 - $result['list'][] = Helpers::formatBanner($one, 640, 240); 191 + foreach ($newsale['data']['list'] as $one) {
  192 + $result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
193 } 193 }
194 } 194 }
195 } 195 }