Showing
1 changed file
with
5 additions
and
3 deletions
@@ -776,7 +776,11 @@ class DetailModel | @@ -776,7 +776,11 @@ class DetailModel | ||
776 | $result['description'] = $product['description']; | 776 | $result['description'] = $product['description']; |
777 | 777 | ||
778 | // 附件 | 778 | // 附件 |
779 | - if (isset($product['attachment'])) { | 779 | + if (!isset($product['attachment'])) { |
780 | + break; | ||
781 | + } | ||
782 | + | ||
783 | + $result['attaches'] = array(); | ||
780 | foreach ($product['attachment'] as $item) { | 784 | foreach ($product['attachment'] as $item) { |
781 | if ($item['isDefault'] === 1) { // 排除默认图片 | 785 | if ($item['isDefault'] === 1) { // 排除默认图片 |
782 | continue; | 786 | continue; |
@@ -784,12 +788,10 @@ class DetailModel | @@ -784,12 +788,10 @@ class DetailModel | ||
784 | 788 | ||
785 | $result['attaches'][] = self::procLimitProductAttach($item); | 789 | $result['attaches'][] = self::procLimitProductAttach($item); |
786 | } | 790 | } |
787 | - } | ||
788 | 791 | ||
789 | if(count($result['attaches']) > 1) { | 792 | if(count($result['attaches']) > 1) { |
790 | Helpers::sortArrByField($result['attaches'], 'orderBy', true); | 793 | Helpers::sortArrByField($result['attaches'], 'orderBy', true); |
791 | } | 794 | } |
792 | - | ||
793 | } while (false); | 795 | } while (false); |
794 | 796 | ||
795 | return $result; | 797 | return $result; |
-
Please register or login to post a comment