Ejemplo n.º 1
0
 /**
  * @param array $communityIds 小区编号
  */
 protected function getCommunityImageUrls($communityIds)
 {
     if (empty($communityIds)) {
         return array();
     }
     // ID去重
     $communityIds = array_flip(array_flip($communityIds));
     $communityImages = Model_Community_Attachment::data_access()->load_field(array('commId', 'fileName', 'hostId'))->filter('commId', $communityIds)->filter('imageSign', Model_Community_Attachment::IMAGE_SIGN_COMMUNITY)->filter('isDefault', Model_Community_Attachment::DEFAULT_YES)->find_all();
     $communityImageUrls = array();
     foreach ($communityImages as $communityImage) {
         $communityImageUrls[$communityImage->commId] = Util_ImageUtils::format_commpicurl_to_larger(Util_ImageUtils::convert_community_image2urlLarge($communityImage->fileName, $communityImage->hostId));
     }
     foreach ($communityIds as $communityId) {
         if (!isset($communityImageUrls[$communityId])) {
             $communityImageUrls[$communityId] = 'http://pages.anjukestatic.com/img/global/nopic2_385x240.gif';
         }
     }
     return $communityImageUrls;
 }