code by view zhangzheng
Showing
1 changed file
with
4 additions
and
2 deletions
@@ -329,7 +329,6 @@ class HomeModel | @@ -329,7 +329,6 @@ class HomeModel | ||
329 | public static function getChannel() | 329 | public static function getChannel() |
330 | { | 330 | { |
331 | $result = array(); | 331 | $result = array(); |
332 | - | ||
333 | if (USE_CACHE) { | 332 | if (USE_CACHE) { |
334 | $key = CacheConfig::KEY_ACTION_INDEX_CONFIG; | 333 | $key = CacheConfig::KEY_ACTION_INDEX_CONFIG; |
335 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 334 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
@@ -340,6 +339,7 @@ class HomeModel | @@ -340,6 +339,7 @@ class HomeModel | ||
340 | } | 339 | } |
341 | 340 | ||
342 | $data = IndexData::channelData(); | 341 | $data = IndexData::channelData(); |
342 | + | ||
343 | if (!empty($data['data']['list'])) { | 343 | if (!empty($data['data']['list'])) { |
344 | $build = array(); | 344 | $build = array(); |
345 | foreach ($data['data']['list'] as $value) { | 345 | foreach ($data['data']['list'] as $value) { |
@@ -372,7 +372,9 @@ class HomeModel | @@ -372,7 +372,9 @@ class HomeModel | ||
372 | default: | 372 | default: |
373 | continue; | 373 | continue; |
374 | } | 374 | } |
375 | - $result['channelList'][] = $build; | 375 | + if (!empty($build)) { |
376 | + $result['channelList'][] = $build; | ||
377 | + } | ||
376 | } | 378 | } |
377 | } | 379 | } |
378 | 380 |
-
Please register or login to post a comment