新品到着,折扣专区顶部banner兼容一张与多张图片;修复新品到着,折扣专区筛选数据选中数据不正确的bug
Showing
3 changed files
with
12 additions
and
7 deletions
@@ -59,12 +59,9 @@ class FloorProcess | @@ -59,12 +59,9 @@ class FloorProcess | ||
59 | { | 59 | { |
60 | $result = array(); | 60 | $result = array(); |
61 | 61 | ||
62 | - foreach ($data as &$one) { | ||
63 | - $one['url'] = Helpers::getFilterUrl($one['url']); | ||
64 | - $one['img'] = Helpers::getImageUrl($one['src'], 640, 310); | ||
65 | - unset($one['src']); | 62 | + foreach ($data as $one) { |
63 | + $result['bannerTop']['list'][] = Helpers::formatBanner($one, 640, 240); | ||
66 | } | 64 | } |
67 | - $result['bannerTop']['list'] = $data; | ||
68 | 65 | ||
69 | return $result; | 66 | return $result; |
70 | } | 67 | } |
@@ -197,6 +197,8 @@ class ListProcess | @@ -197,6 +197,8 @@ class ListProcess | ||
197 | foreach ($result['subs'] as &$val) { | 197 | foreach ($result['subs'] as &$val) { |
198 | if ($val['dataId'] === $gender) { | 198 | if ($val['dataId'] === $gender) { |
199 | $val['chosed'] = true; | 199 | $val['chosed'] = true; |
200 | + | ||
201 | + $result['name'] = $val['name']; | ||
200 | } | 202 | } |
201 | } | 203 | } |
202 | 204 |
@@ -183,8 +183,14 @@ class NewsaleModel | @@ -183,8 +183,14 @@ class NewsaleModel | ||
183 | $newsale = NewsaleData::getNewsaleFocus($codeKey); | 183 | $newsale = NewsaleData::getNewsaleFocus($codeKey); |
184 | 184 | ||
185 | // 调用接口获取数据并封装 | 185 | // 调用接口获取数据并封装 |
186 | - if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) { | ||
187 | - $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240); | 186 | + if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) { |
187 | + if(count($newsale['data'][0]['data']) === 1) { | ||
188 | + $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240); | ||
189 | + } else { | ||
190 | + foreach ($newsale['data'][0]['data'] as $one) { | ||
191 | + $result['list'][] = Helpers::formatBanner($one, 640, 240); | ||
192 | + } | ||
193 | + } | ||
188 | } | 194 | } |
189 | 195 | ||
190 | if (USE_CACHE) { | 196 | if (USE_CACHE) { |
-
Please register or login to post a comment