Esempio n. 1
0
 public function handle_request_internal()
 {
     $propIds = explode(',', $this->_params['propIds']);
     $cityId = $this->_params['cityId'];
     //获取房源信息
     $propsInfos = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId);
     //板块信息
     $blockCode = array();
     $brokerIds = array();
     foreach ($propsInfos as $propsInfoVal) {
         $blockCode[] = substr($propsInfoVal['areaCode'], 8, 4);
         $brokerIds[] = $propsInfoVal['brokerId'];
     }
     $blockInfos = Bll_Community_CommunityGardener::getAreaBlock($blockCode);
     //获取经纪人微聊信息
     $chatInfos = Model_Mobile_BrokerChatInfo::getBrokerChatInfos($brokerIds);
     $propList = array();
     foreach ($propsInfos as $propsInfo) {
         $row = array();
         $row['brokerId'] = $propsInfo['brokerId'];
         $row['chatId'] = $chatInfos[$row['brokerId']]['chatId'];
         $row['propId'] = $propsInfo['proId'];
         $row['cityId'] = $propsInfo['cityId'];
         $row['title'] = $propsInfo['proName'];
         $row['commId'] = $propsInfo['commId'];
         $row['commName'] = $propsInfo['commName'];
         $row['areaCode'] = $propsInfo['areaCode'];
         $row['blockName'] = $blockInfos[$row['areaCode']];
         $row['createTime'] = date("Y-m-d H:i:s", $propsInfo['postDate']);
         $row['room'] = $propsInfo['roomNum'];
         $row['hall'] = $propsInfo['hallNum'];
         $row['toilet'] = $propsInfo['toiletNum'];
         $row['area'] = $propsInfo['areaNum'];
         $row['areaUnit'] = '平米';
         $row['price'] = intval($propsInfo['proPrice']);
         $row['priceUnit'] = '万';
         //获取房源图片
         $houseImageInfo = Bll_Ppc_ServiceAPI::getHouseImageInfo($propsInfo['proId']);
         $houseImageBaseInfos = $houseImageInfo['imageBaseInfo'];
         $houseImageUrls = array();
         if ($houseImageBaseInfos) {
             foreach ($houseImageBaseInfos as $imageInfo) {
                 $houseImageUrls[] = Util_Image::getInstance()->getResizeURL($imageInfo['FILENAME'], $imageInfo['HOST_ID'], 420, 315);
             }
         }
         $row['imageUrls'] = $houseImageUrls;
         $propList[] = $row;
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('props' => $propList));
 }
Esempio n. 2
0
 public function handle_request_internal()
 {
     $brokerIds = explode(',', $this->_params['brokerIds']);
     $cityId = $this->_params['cityId'];
     $sinceId = isset($this->_params['sinceId']) ? intval($this->_params['sinceId']) : 0;
     //从$sinceId 行开始读
     $per = isset($this->_params['per']) ? $this->_params['per'] : 10;
     //每页示的条数
     //二手房 房源表查找房源信息 找出所有的 propIds
     $isComboCity = Bll_City::isComboCity($cityId);
     $propIds = array();
     if ($isComboCity) {
         //如果是套餐城市 套餐房源表中 批量获取经纪人在线房源
         $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerIds, $cityId);
         $propIds = array_keys($comboSpreadHouseList);
         $status = 2;
         //2 套餐 1 定价
     } else {
         //如果是定价城市 获取经纪人定价计划--获取有效计划房源关系
         $fixSpreadPlanList = Bll_Plan_Fix_AjkPlan::getBrokerPlanList($brokerIds);
         //获取经纪人有效定价计划  计划表
         $fixSpreadPlanIds = array_keys($fixSpreadPlanList);
         //获取有效计划房源关系
         $relations = Bll_Plan_Fix_AjkPlan::getPropFixedPlanRelation($brokerIds, $cityId, $fixSpreadPlanIds);
         foreach ($relations as $relation) {
             $propIds[] = $relation['propId'];
         }
         $status = 1;
     }
     //获取房源信息  分页
     $propsInfos = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId, array(), $per + 1, $sinceId);
     //板块信息
     $blockCode = array();
     foreach ($propsInfos as $propsInfoVal) {
         $blockCode[] = substr($propsInfoVal['areaCode'], 8, 4);
     }
     $blockInfos = Bll_Community_CommunityGardener::getAreaBlock($blockCode);
     $hasNextPage = 0;
     //是否有下一页
     $brokerProps = array();
     if (!empty($propsInfos)) {
         $hasNextPage = count($propsInfos) > $per ? 1 : 0;
     }
     if ($hasNextPage) {
         array_pop($propsInfos);
         $sinceId += $per;
     } else {
         $sinceId = 0;
     }
     foreach ($propsInfos as $propsInfo) {
         $row = array();
         $row['brokerId'] = $propsInfo['brokerId'];
         $row['propId'] = $propsInfo['proId'];
         $row['cityId'] = $propsInfo['cityId'];
         $row['title'] = $propsInfo['proName'];
         $row['commId'] = $propsInfo['commId'];
         $row['commName'] = $propsInfo['commName'];
         $row['areaCode'] = $propsInfo['areaCode'];
         $row['blockName'] = $blockInfos[$row['areaCode']];
         $row['createTime'] = date("Y-m-d H:i:s", $propsInfo['postDate']);
         $row['room'] = $propsInfo['roomNum'];
         $row['hall'] = $propsInfo['hallNum'];
         $row['toilet'] = $propsInfo['toiletNum'];
         $row['area'] = $propsInfo['areaNum'];
         $row['areaUnit'] = '平米';
         $row['price'] = intval($propsInfo['proPrice']);
         $row['priceUnit'] = '万';
         //获取房源图片
         $houseImageInfo = Bll_Ppc_ServiceAPI::getHouseImageInfo($propsInfo['proId']);
         $houseImageBaseInfos = $houseImageInfo['imageBaseInfo'];
         $houseImageUrls = array();
         if ($houseImageBaseInfos) {
             foreach ($houseImageBaseInfos as $imageInfo) {
                 $houseImageUrls[] = Util_Image::getInstance()->getResizeURL($imageInfo['FILENAME'], $imageInfo['HOST_ID'], 420, 315);
             }
         }
         $row['imageUrls'] = $houseImageUrls;
         $row['status'] = $status;
         $brokerProps[] = $row;
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('brokerProps' => $brokerProps, 'hasNextPage' => $hasNextPage, 'sinceId' => $sinceId));
 }