修改首页两张小图类型的楼层的数据格式
Code Review By Rock Zhang
Showing
1 changed file
with
4 additions
and
5 deletions
@@ -273,7 +273,7 @@ class FloorProcess | @@ -273,7 +273,7 @@ class FloorProcess | ||
273 | isset(self::$channel[$type]) && $urlParam['gender'] = self::$channel[$type]; | 273 | isset(self::$channel[$type]) && $urlParam['gender'] = self::$channel[$type]; |
274 | $value['more_url'] = Helpers::url('', $urlParam, 'guang'); | 274 | $value['more_url'] = Helpers::url('', $urlParam, 'guang'); |
275 | } | 275 | } |
276 | - if ($key == 'list') { | 276 | + if ($key == 'list' && is_array($value)) { |
277 | foreach ($value as &$one) { | 277 | foreach ($value as &$one) { |
278 | if (isset($one['url'])) { | 278 | if (isset($one['url'])) { |
279 | $one['url'] = Helpers::getFilterUrl($one['url']); | 279 | $one['url'] = Helpers::getFilterUrl($one['url']); |
@@ -379,9 +379,6 @@ class FloorProcess | @@ -379,9 +379,6 @@ class FloorProcess | ||
379 | */ | 379 | */ |
380 | private static function small_pic($data, $type) | 380 | private static function small_pic($data, $type) |
381 | { | 381 | { |
382 | - // 按照以前业务操作,不显示 | ||
383 | - return array(); | ||
384 | - | ||
385 | $result = array(); | 382 | $result = array(); |
386 | 383 | ||
387 | foreach ($data as &$one) { | 384 | foreach ($data as &$one) { |
@@ -391,7 +388,9 @@ class FloorProcess | @@ -391,7 +388,9 @@ class FloorProcess | ||
391 | $one['img'] = Helpers::getImageUrl($one['src'], 98, 98); | 388 | $one['img'] = Helpers::getImageUrl($one['src'], 98, 98); |
392 | unset($one['src']); | 389 | unset($one['src']); |
393 | } | 390 | } |
394 | - $result['small_pic'] = $data; | 391 | + if (!empty($data)) { |
392 | + $result['smallPic']['list'] = $data; | ||
393 | + } | ||
395 | 394 | ||
396 | return $result; | 395 | return $result; |
397 | } | 396 | } |
-
Please register or login to post a comment