Ejemplo n.º 1
0
 private static function preparePropInfo(&$out)
 {
     // 获取房源
     $propResult = Bll_House_HzHouse::getPropInfo($out['proId'], $out['cityId'], 3);
     if (!$propResult['status']) {
         throw new Exception($propResult['msg']);
     }
     $propInfo = $propResult['msg'];
     // 检查并拼接违规信息
     $illegalInfo = Bll_HzProp::checkAndGetPropsIllegalInfos(array($out['proId'] => $propInfo));
     $propInfo = $illegalInfo[$out['proId']];
     // 获取剩余时间
     $propInfo['leftDays'] = Bll_House_HzHouse::getLeftDays($propInfo['created']);
     // 获取房源图片数
     $imageInfo = Bll_House_HzHouse::getPropImages($out['proId']);
     $propInfo['imageInfo'] = $imageInfo;
     // 房源默认图片 (默认优先封面图 -》 第一张室内图 -》 房型)
     //$propInfo['propDefaultImg'] = Bll_House_HzHouse::getPropDefaultImgWithUrl($out['proId']);
     $propInfo['propDefaultImg'] = self::getThumbImg($imageInfo);
     // 获取房源可优化项
     $propInfo['canImproveItems'] = self::getPropCanImproveItems($propInfo, $imageInfo);
     // 是否手机发房
     $propInfo['isMobile'] = isset($propInfo['from']) ? Bll_House_HzHouse::isMobileProp($propInfo['from']) : false;
     // 此房源全部点击数据
     $propInfo['propAllClick'] = Model_Stats_PropClick::getPropAllClicks($out['proId'], $out['hzBrokerId'], $out['cityId']);
     // 此房源全部曝光数据
     $propInfo['propAllShow'] = Bll_House_HzHouse::getPropShow($out['proId'], $out['cityId']);
     // 此房源质量
     $propQuality = Model_Stats_HzPropQuality::getPropsquality($out['proId']);
     $propInfo['propsQuality'] = $propQuality ? $propQuality[$out['proId']] : array();
     // 根据blockid 获取对应code
     $areaInfo = Model_City_HzArea::getAreaById($propInfo['blockid']);
     $propInfo['typeCode'] = $areaInfo['typeCode'];
     return $propInfo;
 }