Exemplo n.º 1
0
 /**
  * @return Util_Image
  */
 public static function getInstance()
 {
     if (!self::$_objInstance instanceof self) {
         self::$_objInstance = new self();
     }
     return self::$_objInstance;
 }
Exemplo n.º 2
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $cityId = $this->_params['cityId'];
     $result['status'] = 'ok';
     $propertyList = array();
     $subscriptionInfo = Model_Choice_Subscription::selectData(array(Model_Choice_Subscription::SITE => Model_Choice_Subscription::SITE_AJK, Model_Choice_Subscription::BROKER_ID => $brokerId, Model_Choice_Subscription::STATUS => Model_Choice_Subscription::SUBSCRIPTION_START));
     if (!empty($subscriptionInfo)) {
         $propIds = array();
         foreach ($subscriptionInfo as $row) {
             $propIds[] = $row['propId'];
         }
         $houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId, array('postDate' => 'desc'));
         //房源点击量
         $proClickDao = new DAO_My_Ppc_PlanOpe();
         $proClickInfo = $proClickDao->getProClick($propIds, strtotime("20120901"));
         foreach ($houseInfo as $row) {
             $propId = $row['proId'];
             $list['propId'] = $propId;
             $list['title'] = $row['proName'];
             $list['commId'] = $row['commId'];
             $list['commName'] = $row['commName'];
             $list['roomNum'] = $row['roomNum'];
             $list['hallNum'] = $row['hallNum'];
             $list['toiletNum'] = $row['toiletNum'];
             $list['area'] = round($row['areaNum']);
             $list['price'] = round($row['proPrice']);
             $list['priceUnit'] = '万';
             $list['totalClicks'] = isset($proClickInfo[$propId]) ? $proClickInfo[$propId] : 0;
             $list['isBid'] = $list['isChoice'] = 0;
             $list['isMoreImg'] = $row['isHighQulity'];
             $list['isVisible'] = $row['isVisible'];
             $list['isPhonePub'] = $row['uriCode'] == 'mobile.asyn' || $row['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
             $list['createTime'] = $row['postDate'];
             $imgBll = Bll_Image_EsfHouseImage::getInstance();
             $list['imgUrl'] = $imgBll->getThumbImageUrl($propId, $row['commId']);
             //委托房源标签
             $list['isEntrust'] = $row['commitionType'] == 2 ? 1 : 0;
             $propertyList[] = $list;
         }
     }
     $result['data']['propertyList'] = $propertyList;
     return $result;
 }
Exemplo n.º 3
0
 public static function imageUrl($fileName)
 {
     $imgBll = Bll_Image_EsfHouseImage::getInstance();
     $image_url = PageHelper::pure_static_url('/img/global/nopic_150x113.gif');
     if ($fileName) {
         $image_url = $fileName;
         if (preg_match("/,/", $image_url)) {
             $img = array();
             $arr = explode(",", $image_url);
             if ($arr[0] > 0) {
                 $img['host_id'] = $arr[0];
                 $img['FileName'] = $arr[1];
             }
             $image_url = $imgBll->convert_property_image_to_icon_url($img['FileName'], $img['host_id']);
             if (isset($image_url['photourl'])) {
                 $image_url = $image_url['photourl'];
             }
         }
     }
     return $image_url;
 }
Exemplo n.º 4
0
 public function handle_request_internal()
 {
     // TODO: Implement handle_request_internal() method.
     $result['status'] = 'ok';
     $cityId = $this->_params['cityId'];
     $brokerId = $this->_params['brokerId'];
     $relations = Model_Plan_AjkFixRelation::getRelationListByPlanId($this->_params['planId'], $cityId);
     $propertyList = array('newList' => array(), 'oldList' => array());
     if (!empty($relations)) {
         $propIds = array();
         foreach ($relations as $row) {
             $propIds[] = $row['proId'];
         }
         $houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId, array('postDate' => 'desc'));
         //房源点击量
         $proClickDao = new DAO_My_Ppc_PlanOpe();
         $proClickInfo = $proClickDao->getProClick($propIds, strtotime("20120901"));
         $spreads = Model_Plan_AjkPropspread::getAjkPropSpreadByIds($propIds);
         if (!empty($spreads)) {
             foreach ($spreads as $row) {
                 $spreadArr[$row['propId']]['bidVersion'] = $row['bidVersion'];
                 $spreadArr[$row['propId']]['status'] = $row['status'];
             }
         }
         foreach ($houseInfo as $row) {
             $propId = $row['proId'];
             $list['propId'] = $propId;
             $list['title'] = $row['proName'];
             $list['commId'] = $row['commId'];
             $list['commName'] = $row['commName'];
             $list['roomNum'] = $row['roomNum'];
             $list['hallNum'] = $row['hallNum'];
             $list['toiletNum'] = $row['toiletNum'];
             $list['area'] = round($row['areaNum']);
             $list['price'] = is_float($row['proPrice']) ? round($row['proPrice'], 1) : $row['proPrice'];
             $list['priceUnit'] = '万';
             $list['totalClicks'] = isset($proClickInfo[$propId]) ? $proClickInfo[$propId] : 0;
             $list['isBid'] = $list['isChoice'] = 0;
             if (isset($spreadArr) && isset($spreadArr[$propId])) {
                 if ($spreadArr[$propId]['bidVersion'] == 1 && $spreadArr[$propId]['status'] == 1) {
                     $list['isBid'] = 1;
                 } elseif ($spreadArr[$propId]['bidVersion'] == 2 && ($spreadArr[$propId]['status'] == 1 || $spreadArr[$propId]['status'] == 11)) {
                     $list['isChoice'] = 1;
                 }
             }
             $list['isMoreImg'] = $row['isHighQulity'];
             $list['isVisible'] = $row['isVisible'];
             $list['isPhonePub'] = $row['uriCode'] == 'mobile.asyn' || $row['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
             $list['createTime'] = $row['postDate'];
             $imgBll = Bll_Image_EsfHouseImage::getInstance();
             $list['imgUrl'] = $imgBll->getThumbImageUrl($propId, $row['commId']);
             //增加委托房源标签
             if ($row['commitionType'] == 2) {
                 $list['isEntrust'] = 1;
             } else {
                 $list['isEntrust'] = 0;
             }
             //计算出房源推广天数
             $timeFixStr = strtotime(date("Ymd", $row['postDate']));
             $leftDay = floor((time() - $timeFixStr) / 86400);
             if ($leftDay >= 30) {
                 $propertyList['oldList'][] = $list;
             } else {
                 $propertyList['newList'][] = $list;
             }
         }
     }
     $result['data'] = $propertyList;
     return $result;
 }
Exemplo n.º 5
0
 /**
  * 转换房源数组key
  *
  * @param $propInfo array 单个元素为对象
  */
 public function formatPropInfo(&$propInfo)
 {
     $imgBll = Bll_Image_EsfHouseImage::getInstance();
     $finalPropInfo = array();
     foreach ($propInfo as $key => $row) {
         //id
         $finalPropInfo[$row->proId]['propId'] = $finalPropInfo[$row->proId]['id'] = $row->proId;
         //房源标题
         $finalPropInfo[$row->proId]['title'] = $row->proName;
         //小区id
         $finalPropInfo[$row->proId]['commId'] = $row->commId;
         //小区名称
         $finalPropInfo[$row->proId]['commName'] = $row->commName;
         //户型
         $finalPropInfo[$row->proId]['roomNum'] = $row->roomNum;
         $finalPropInfo[$row->proId]['hallNum'] = $row->hallNum;
         $finalPropInfo[$row->proId]['toiletNum'] = $row->toiletNum;
         //大小
         $finalPropInfo[$row->proId]['area'] = round($row->areaNum);
         //价格
         $finalPropInfo[$row->proId]['price'] = intval($row->proPrice);
         $finalPropInfo[$row->proId]['priceUnit'] = '万';
         //icoin
         $finalPropInfo[$row->proId]['isMoreImg'] = $row->isHighQulity;
         //1-多图 0-非多图
         $finalPropInfo[$row->proId]['isPhonePub'] = $row->uriCode == 'mobile.asyn' || $row->uriCode == 'mobile-ajk-broker.asyn' ? 1 : 0;
         //1-手机房源 0-非手机房源
         $finalPropInfo[$row->proId]['isVisible'] = $row->isVisible;
         //0-违规房源 1-非违规房源
         //房源图片
         $finalPropInfo[$row->proId]['imgUrl'] = $imgBll->getThumbImageUrl($row->proId, $row->commId);
         //是否精选
         $finalPropInfo[$row->proId]['isChoice'] = 1;
         //0-非精选 1-精选
         //今日点击
         $finalPropInfo[$row->proId]['totalClicks'] = 0;
         //委托房源标记
         if ($row->commitionType == 2) {
             $finalPropInfo[$row->proId]['isEntrust'] = 1;
         } else {
             $finalPropInfo[$row->proId]['isEntrust'] = 0;
         }
     }
     return $finalPropInfo;
 }
Exemplo n.º 6
0
 function getComboPropsInOneComm($brokerId, $cityId, $commId = '')
 {
     $base_domain = APF::get_instance()->get_config('base_domain');
     //获取套餐推广信息
     $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerId, $cityId);
     if (empty($comboSpreadHouseList)) {
         return array();
     } else {
         //获取房源信息
         $propIds = array_keys($comboSpreadHouseList);
         $propsInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId);
     }
     //房源计划形态(是精选还是竞价)
     $spreads = array();
     if ($propIds) {
         $spreads = Model_Plan_AjkPropspread::getAjkPropSpreadByIds($propIds);
     }
     if (!empty($spreads)) {
         foreach ($spreads as $row) {
             $spreadArr[$row['propId']]['bidVersion'] = $row['bidVersion'];
             $spreadArr[$row['propId']]['status'] = $row['status'];
         }
     }
     foreach ($propsInfo as $propArr) {
         $propId = $propArr['proId'];
         $commProps[$propArr['commId']][$propId]['id'] = $propId;
         $commProps[$propArr['commId']][$propId]['title'] = $propArr['proName'];
         $commProps[$propArr['commId']][$propId]['commId'] = $propArr['commId'];
         $commProps[$propArr['commId']][$propId]['commName'] = $propArr['commName'];
         $commProps[$propArr['commId']][$propId]['roomNum'] = $propArr['roomNum'];
         $commProps[$propArr['commId']][$propId]['hallNum'] = $propArr['hallNum'];
         $commProps[$propArr['commId']][$propId]['toiletNum'] = $propArr['toiletNum'];
         $commProps[$propArr['commId']][$propId]['area'] = $propArr['areaNum'];
         $commProps[$propArr['commId']][$propId]['price'] = $propArr['proPrice'];
         $commProps[$propArr['commId']][$propId]['priceUnit'] = '万';
         $commProps[$propArr['commId']][$propId]['isVisible'] = $propArr['isVisible'];
         $commProps[$propArr['commId']][$propId]['imgUrl'] = 'http://pages.anjukestatic.com/img/global/nopic_100x75.gif';
         $commProps[$propArr['commId']][$propId]['isMoreImg'] = $propArr['isHighQulity'] ? 1 : 0;
         $commProps[$propArr['commId']][$propId]['isPhonePub'] = $propArr['uriCode'] == 'mobile.asyn' || $propArr['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
         $commProps[$propArr['commId']][$propId]['propUrl'] = 'http://' . $base_domain . '/web/sale/x/' . $propArr['cityId'] . '/' . $propId;
         $commProps[$propArr['commId']][$propId]['createTime'] = date('Y-m-d H:i:s', $propArr['postDate']);
         $commProps[$propArr['commId']][$propId]['totalClicks'] = isset($proClickInfo[$propId]) ? $proClickInfo[$propId] : 0;
         $commProps[$propArr['commId']][$propId]['isBid'] = $commProps[$propArr['commId']][$propId]['isChoice'] = 0;
         if (isset($spreadArr) && isset($spreadArr[$propId])) {
             if ($spreadArr[$propId]['bidVersion'] == 1 && $spreadArr[$propId]['status'] == 1) {
                 $commProps[$propArr['commId']][$propId]['isBid'] = 1;
             } elseif ($spreadArr[$propId]['bidVersion'] == 2 && ($spreadArr[$propId]['status'] == 1 || $spreadArr[$propId]['status'] == 11)) {
                 $commProps[$propArr['commId']][$propId]['isChoice'] = 1;
             }
         }
         $imgBll = Bll_Image_EsfHouseImage::getInstance();
         $commProps[$propArr['commId']][$propId]['imgUrl'] = $imgBll->getThumbImageUrl($propId, $propArr['commId']);
     }
     $return = $commProps;
     if ($commId) {
         $ret['status'] = 'ok';
         $ret['data']['propertyList'] = $return[$commId] ? array_values($return[$commId]) : array();
     } else {
         $ret = $return;
     }
     return $ret;
 }
Exemplo n.º 7
0
 public function handle_request_internal()
 {
     header("Access-Control-Allow-Origin: *");
     $propId = $this->_params['propId'];
     //好丑陋。。。。。。好无奈。。。。。。
     //委托房源自动转发停用,为了app能够展示报错信息。。。
     if (empty($propId)) {
         $this->_params['apiDebug'] = 1;
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => '0000', 'message' => '委托房源自动转发功能已停用;若要发布请手动发布');
     }
     $propInfo = Bll_Ppc_ServiceAPI::getHouseInfo($propId);
     $brokerId = $this->_params['brokerId'];
     $houseInfo = Model_House_EsfHouseElementFactory::getHouseBaseInfo($propId);
     if (empty($houseInfo)) {
         $cityId = Model_Broker_AjkBrokerExtend::getCityIdByBrokerId($this->_params['brokerId']);
         $houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propId, $cityId);
     }
     if (!empty($houseInfo)) {
         $result['status'] = 'ok';
         $areaCode = $houseInfo['areaCode'];
         $block = Bll_Commtype_Api::getInfoByTypeCode($areaCode);
         $area = Bll_Commtype_Api::getInfoByTypeId($block['parentId']);
         $area_name = $area['typeName'];
         $block_name = $block['typeName'];
         $data['title'] = $houseInfo['proName'];
         $data['commId'] = $houseInfo['commId'];
         $data['commName'] = $houseInfo['commName'];
         //小区信息
         $commInfo = Bll_Community_APIComm::getInstance()->getInfoByIdMapping($data['commId'], 2);
         $data['commLocation'] = $commInfo['commLocal'];
         $data['sosolat'] = $commInfo['sosolat'];
         //纬度
         $data['sosolng'] = $commInfo['sosolng'];
         //经度
         $data['floor'] = $propInfo['property']['ProFloor'];
         $data['totalFloor'] = $propInfo['property']['FloorNum'];
         $propDescription = $propInfo['property']['sale']['AddExplan'];
         $propDescription = str_replace('<p>', "", $propDescription);
         $propDescription = str_replace('</p>', "", $propDescription);
         $propDescription = trim($propDescription);
         $data['propDescription'] = $propDescription;
         $data['areaname'] = $area_name;
         $data['blockname'] = $block_name;
         $data['roomNum'] = $houseInfo['roomNum'];
         $data['hallNum'] = $houseInfo['hallNum'];
         $data['toiletNum'] = $houseInfo['toiletNum'];
         $data['area'] = $houseInfo['areaNum'];
         $data['areaUnit'] = '平米';
         $data['price'] = $houseInfo['proPrice'];
         $data['priceUnit'] = '万';
         $data['isMoreImg'] = $houseInfo['isHighQulity'];
         $data['isVisible'] = $houseInfo['isVisible'];
         $data['isPhonePub'] = $houseInfo['uriCode'] == 'mobile.asyn' || $houseInfo['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
         $data['propImagesUrl'] = array();
         $data['propImages'] = $data['outdoorImage'] = array();
         if ($propInfo['attachments']['attachments']) {
             $propImageNum = 0;
             $outdoorImageNum = 0;
             $images = $propInfo['attachments']['attachments'];
             foreach ($images as $image) {
                 if ($image['DataType'] == 2) {
                     if ($propImageNum >= 8) {
                         continue;
                     }
                     $imageInfo = array();
                     $url = Util_ImageUtils::getResizeURL($image['FileName'], $image['host_id'], 600, 600);
                     $url = str_replace("display", "display/e", $url);
                     $imageInfo['bigImageUrl'] = $url;
                     $data['propImages'][] = $imageInfo;
                     $propImageNum += 1;
                 } else {
                     if ($image['DataType'] == 3) {
                         if ($outdoorImageNum >= 1) {
                             continue;
                         }
                         $imageInfo = array();
                         $url = Util_ImageUtils::getResizeURL($image['FileName'], $image['host_id'], 600, 600);
                         $url = str_replace("display", "display/e", $url);
                         $imageInfo['bigImageUrl'] = $url;
                         $data['outdoorImage'][] = $imageInfo;
                         $outdoorImageNum += 1;
                     }
                 }
             }
         }
         $spread = Model_Plan_AjkPropspread::getAjkPropSpreadByIds($propId);
         $data['isChoice'] = $data['isBid'] = 0;
         if (!empty($spread)) {
             if ($spread[0]['bidVersion'] == 1 && $spread[0]['status'] == 1) {
                 $data['isBid'] = 1;
             } elseif ($spread[0]['bidVersion'] == 2 && ($spread[0]['status'] == 1 || $spread[0]['status'] == 11)) {
                 $data['isChoice'] = 1;
             }
         }
         //计算出房源推广天数
         $timeFixStr = strtotime(date("Ymd", $houseInfo['postDate']));
         $leftDay = floor((time() - $timeFixStr) / 86400);
         $data['publishDaysMsg'] = $leftDay > 0 ? $leftDay . '天前发布' : '今天发布';
         $imgBll = Bll_Image_EsfHouseImage::getInstance();
         $data['imgUrl'] = $imgBll->getThumbImageUrl($propId, $houseInfo['commId']);
         $mobileBaseDomain = APF::get_instance()->get_config("mobile_base_domain");
         $data['url'] = 'http://' . $mobileBaseDomain . '/sale/x/' . $houseInfo['cityId'] . '/' . $houseInfo->proId;
         //增加委托房源标签
         if ($houseInfo['commitionType'] == 2) {
             $data['isEntrust'] = 1;
         } else {
             $data['isEntrust'] = 0;
         }
     } else {
         $data['status'] = 'error';
         $data['message'] = '房源信息不存在';
     }
     $result['data'] = $data;
     return $result;
 }
Exemplo n.º 8
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $cityId = $this->_params['cityId'];
     $props = Bll_BrokerInfoApp::get_outline_prop($brokerId, $cityId);
     $return = array();
     $return['status'] = 'ok';
     $return['data']['propertyList'] = array();
     //APP套餐城市调错API了 需要做一下套餐城市的兼容处理
     $isComboBroker = Bll_Broker_HzBroker::isComboBroker($brokerId);
     if (!$isComboBroker) {
         if (!empty($props)) {
             $propRow = array();
             foreach ($props as $propertyList) {
                 $propRow['propId'] = $propRow['id'] = $propertyList['ProId'];
                 $propRow['title'] = $propertyList['ProName'];
                 $propRow['commId'] = $propertyList['CommId'];
                 $propRow['commName'] = $propertyList['CommName'];
                 $propRow['roomNum'] = $propertyList['RoomNum'];
                 $propRow['hallNum'] = $propertyList['HallNum'];
                 $propRow['toiletNum'] = $propertyList['ToiletNum'];
                 $propRow['area'] = round($propertyList['AreaNum']);
                 $propRow['price'] = is_float($propertyList['ProPrice']) ? round($propertyList['ProPrice'], 1) : $propertyList['ProPrice'];
                 $propRow['priceUnit'] = '万';
                 $propRow['isMoreImg'] = $propertyList['IsHighQulity'];
                 $propRow['isVisible'] = $propertyList['IsVisible'];
                 $propRow['isPhonePub'] = $propertyList['UriCode'] == 'mobile.asyn' || $propertyList['UriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
                 $propRow['createTime'] = date('Y-m-d H:i:s', $propertyList['PostDate']);
                 $imgBll = Bll_Image_EsfHouseImage::getInstance();
                 $propRow['imgUrl'] = $imgBll->getThumbImageUrl($propertyList['ProId'], $propertyList['commId']);
                 //增加委托房源标签
                 if ($propertyList['CommitionType'] == 2) {
                     $propRow['isEntrust'] = 1;
                 } else {
                     $propRow['isEntrust'] = 0;
                 }
                 $return['data']['propertyList'][] = $propRow;
                 unset($propRow);
             }
         }
         return $return;
     } else {
         $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
         if (!$brokerInfo) {
             throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
         }
         //获取套餐推广信息
         $cityId = $brokerInfo->cityId;
         $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerId, $cityId);
         $comboSpreadHouseIds = array_keys($comboSpreadHouseList);
         //获取经纪人所有房源信息
         $tempHouseInfoList = Bll_House_EsfHouse::getBrokerAllPropInfoList($brokerId, $cityId);
         if (empty($tempHouseInfoList)) {
             return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => array()));
         }
         //未推广房源列表
         $tempNoSpreadHouseList = array();
         $noSpreadHouseIds = array();
         foreach ($tempHouseInfoList as $houseInfo) {
             if (!in_array($houseInfo['proId'], $comboSpreadHouseIds)) {
                 $houseInfo['illegal'] = isset($houseInfo['isVisible']) ? $houseInfo['isVisible'] : 1;
                 //0-违规房源 1-非违规房源
                 $tempNoSpreadHouseList[$houseInfo['proId']] = $houseInfo;
                 $noSpreadHouseIds[] = $houseInfo['proId'];
             }
         }
         /** 过滤违规房源 */
         $tmpIllegalList = array();
         if (!$noSpreadHouseIds) {
             return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => array()));
         }
         foreach ($tempNoSpreadHouseList as $propId => $houseInfo) {
             if ($houseInfo['illegal'] == 0 && $houseInfo['expireWorker'] != 'propertyReport') {
                 $tmpIllegalList[$propId] = $houseInfo;
                 unset($tempNoSpreadHouseList[$propId]);
             }
         }
         //违规房源排在前面
         $noSpreadHouseList = array_merge($tmpIllegalList, $tempNoSpreadHouseList);
         $propDefImages = Model_House_AjkPropertyData::getDafImages($noSpreadHouseIds);
         $propertyList = array();
         foreach ($noSpreadHouseList as $houseInfo) {
             $row = array();
             $row['propId'] = $houseInfo['proId'];
             $row['title'] = $houseInfo['proName'];
             $row['commId'] = $houseInfo['commId'];
             $row['commName'] = $houseInfo['commName'];
             $row['roomNum'] = $houseInfo['roomNum'];
             $row['hallNum'] = $houseInfo['hallNum'];
             $row['area'] = round($houseInfo['areaNum']);
             $row['toiletNum'] = $houseInfo['toiletNum'];
             $row['price'] = intval($houseInfo['proPrice']);
             $row['priceUnit'] = '万';
             $row['isBid'] = 0;
             $row['isChoice'] = 0;
             $row['isMoreImg'] = $houseInfo['isHighQulity'];
             $row['isPhonePub'] = $houseInfo['uriCode'] == 'mobile.asyn' || $houseInfo['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
             $row['isVisible'] = $houseInfo['illegal'];
             //0-违规房源 1-非违规房源
             $row['createTime'] = $houseInfo['postDate'];
             //房源发布时间
             $row['imgUrl'] = $row['imgUrl'] = Model_House_AjkPropertyData::imageUrl($propDefImages[$houseInfo['proId']]);
             //print_r($houseInfo['commitionType']);exit;
             $row['isEntrust'] = $houseInfo['commitionType'] == 2 ? 1 : 0;
             $propertyList[] = $row;
         }
         //排序
         usort($propertyList, function ($a, $b) {
             if ($a['createTime'] == $b['createTime']) {
                 return 0;
             }
             return $a['createTime'] > $b['createTime'] ? -1 : 1;
         });
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => $propertyList));
     }
 }
Exemplo n.º 9
0
 /**
  * 拼接房源具体信息
  *
  * @param $houseIdStr
  * @return array
  */
 public function getProductDetail($houseIdStr)
 {
     $houseArray = array();
     if (empty($houseIdStr)) {
         return $houseArray;
     }
     $houseIdArray = explode(',', $houseIdStr);
     $imgBll = Bll_Image_EsfHouseImage::getInstance();
     foreach ($houseIdArray as $row) {
         $houseInfo = Model_House_EsfHouseElementFactory::getHouseBaseInfo($row);
         if (empty($houseInfo)) {
             continue;
         }
         $formatHouseInfo = array();
         //房源标题
         $formatHouseInfo['title'] = $houseInfo->proName;
         //板块名称
         $block = Model_City_TypeCode::getTypeCodeNames(array($houseInfo->areaCode));
         if (empty($block)) {
             $formatHouseInfo['block'] = '';
         } else {
             $formatHouseInfo['block'] = $block[$houseInfo->areaCode];
         }
         //小区名称
         $formatHouseInfo['community'] = $houseInfo->commName;
         //户型
         $formatHouseInfo['type'] = sprintf('%d室%d厅', $houseInfo->roomNum, $houseInfo->hallNum);
         //大小
         $formatHouseInfo['area'] = sprintf('%d平米', intval($houseInfo->areaNum));
         //价格
         $formatHouseInfo['price'] = sprintf('%d万', intval($houseInfo->proPrice));
         //房源图片
         $formatHouseInfo['pic'] = $imgBll->getThumbImageUrl($houseInfo->proId, $houseInfo->commId);
         $houseArray[] = $formatHouseInfo;
     }
     return $houseArray;
 }