public function handle_request_internal()
 {
     //根据安居客经纪人ID获取好租经纪人ID
     $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']);
     $city_id = $this->_params['cityId'];
     $result = Bll_HzFixPlan::get_outline_list($brokerId_hz, $city_id, 0);
     $return = array();
     $return["status"] = "ok";
     $return['data']['num'] = $result;
     return $return;
 }
Example #2
0
 public function handle_request_internal()
 {
     /*
     @params planId :计划id
     @params resType :默认为0,0表示不取计划房源信息,1为取房源信息
     @params from :来源
     @success return 该计划id的信息
     */
     if (!isset($this->_params['brokerId'])) {
         return Util_MobileAPI::error(Const_APIStatus::E_PLAN_PARAM_BROKERID_MISS);
     }
     if (!isset($this->_params['cityId'])) {
         return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS);
     }
     //根据安居客经纪人ID获取好租经纪人ID
     $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']);
     $result = Bll_HzFixPlan::get_outline_list($brokerId_hz, $this->_params['cityId'], 1, false);
     $return = array();
     $return["status"] = "ok";
     $return["data"]['propertyList'] = array();
     if (!empty($result)) {
         $proprow = array();
         foreach ($result as $propertyList) {
             $proprow["id"] = $propertyList['proid'];
             $proprow["title"] = $propertyList['content_basic']['title'];
             $proprow["commId"] = $propertyList['content_basic']['commid'];
             $proprow["commName"] = $propertyList['content_basic']['commname'];
             $proprow["roomNum"] = $propertyList['content_basic']['roomnum'];
             $proprow["hallNum"] = $propertyList['content_basic']['hallnum'];
             $proprow["toiletNum"] = $propertyList['content_basic']['toilnetnum'];
             $proprow["area"] = round($propertyList['content_basic']['areanum']);
             $proprow["price"] = round($propertyList['content_basic']['pricenum']);
             $proprow["isMoreImg"] = $propertyList['content_basic']['quality'] ? 1 : 0;
             $proprow["priceUnit"] = "元";
             $return["data"]['propertyList'][] = $proprow;
             unset($proprow);
         }
         unset($result);
     }
     return $return;
 }
Example #3
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $cityId = $this->_params['cityId'];
     // 获取未推广房源列表
     $hzBrokerId = Bll_HzBroker::get_brokerid_by_ajk_brokerid($brokerId);
     //APP套餐城市调错API了 需要做一下套餐城市的兼容处理
     $isComboBroker = Bll_Broker_HzBroker::isComboBroker($brokerId);
     if (!$isComboBroker) {
         $props = Bll_HzFixPlan::get_outline_list($hzBrokerId, $cityId, 1);
         $propIds = array();
         $propertyList = array();
         foreach ($props as $prop) {
             $propId = $prop['proid'];
             $propIds[] = $propId;
             $row = array();
             $row['propId'] = $row['id'] = $propId;
             $row['title'] = $prop['content_basic']['title'];
             $row['imgUrl'] = '';
             $row['commId'] = $prop['content_basic']['commid'];
             $row['commName'] = $prop['content_basic']['commname'];
             $row['roomNum'] = $prop['content_basic']['roomnum'];
             $row['hallNum'] = $prop['content_basic']['hallnum'];
             $row['toiletNum'] = $prop['content_basic']['toilnetnum'];
             $row['area'] = round($prop['content_basic']['areanum']);
             $row['price'] = round($prop['content_basic']['pricenum']);
             $row['priceUnit'] = '元/月';
             $row['isBid'] = 0;
             $row['isChoice'] = 0;
             $row['isVisible'] = intval($prop['content_basic']['status'] != 6);
             $row['isMoreImg'] = intval($prop['content_basic']['quality']);
             $row['isPhonePub'] = intval(isset($prop['content_basic']['from']) && $prop['content_basic']['from'] == 'mobile-ajk-broker');
             $row['publishDays'] = floor((time() - $prop['content_basic']['created']) / 86400);
             $row['publishDaysMsg'] = $row['publishDays'] > 0 ? "{$row['publishDays']}天前发布" : '今天发布';
             $row['createTime'] = date('Y-m-d H:i:s', $prop['content_basic']['created']);
             $row['updateTime'] = date('Y-m-d H:i:s', $prop['content_basic']['updated']);
             //增加委托房源标签
             $isEntrust = Bll_Zufang_Choice::isCommissionHouse($propId, $brokerId, Model_House_Commission::TYPE_RENT);
             $row['isEntrust'] = $isEntrust ? 1 : 0;
             $propertyList[$propId] = $row;
         }
         if ($propIds) {
             // 批量获取房源的默认图片
             $defaultImages = Model_Image_HzImage::getDefaultImagesByHouseIds($propIds);
             foreach ($defaultImages as $defaultImage) {
                 $propertyList[$defaultImage['proid']]['imgUrl'] = $defaultImage->imageUrl();
             }
         }
         $result = array();
         $result['status'] = Const_APIStatus::RETURN_CODE_OK;
         $result['data']['propertyList'] = array_values($propertyList);
         return $result;
     } else {
         //获取所有有效房源
         $props = Bll_House_HzHouse::getValidPropsByBrokerId($hzBrokerId, $cityId);
         $propertyList = array();
         if (!empty($props)) {
             //获取套餐推广房源列表
             $comboList = Bll_Combo_HouseRelation::getHouseRelations($brokerId, Bll_Combo_HouseRelation::SITE_TYPE_HZ, 1);
             //所有有效房源-套餐推广房源 = 套餐未推广房源
             if (!empty($comboList)) {
                 foreach ($comboList as $row) {
                     unset($props[$row['houseId']]);
                 }
             }
             if (!empty($props)) {
                 // 批量获取房源的默认图片
                 $defaultImages = Model_Image_HzImage::getDefaultImagesByHouseIds(array_keys($props));
                 if (!empty($defaultImages)) {
                     foreach ($defaultImages as $defaultImage) {
                         $props[$defaultImage['proid']]['imgUrl'] = $defaultImage->imageUrl();
                     }
                 }
                 foreach ($props as $list) {
                     $row = array();
                     $row['id'] = $row['propId'] = $list['propId'];
                     $row['title'] = $list['title'];
                     $row['imgUrl'] = $list['imgUrl'] ?: '';
                     $row['commId'] = $list['commid'];
                     $row['commName'] = $list['commname'];
                     $row['roomNum'] = $list['roomnum'];
                     $row['hallNum'] = $list['hallnum'];
                     $row['toiletNum'] = $list['toilnetnum'];
                     $row['area'] = round($list['areanum']);
                     $row['price'] = round($list['pricenum']);
                     $row['priceUnit'] = '元/月';
                     $row['todayClicks'] = $row['totalClicks'] = $row['isBid'] = $row['isChoice'] = 0;
                     $row['isVisible'] = (int) ($list['status'] != 6);
                     $row['isMoreImg'] = (int) $list['quality'];
                     $row['isPhonePub'] = (int) (isset($list['from']) && $list['from'] == 'mobile-ajk-broker');
                     $isEntrust = Bll_Zufang_Choice::isCommissionHouse($list['propId'], $brokerId, Model_House_Commission::TYPE_RENT);
                     $row['isEntrust'] = $isEntrust ? 1 : 0;
                     $row['createTime'] = date('Y-m-d H:i:s', $list['created']);
                     $propertyList[] = $row;
                 }
             }
         }
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => $propertyList));
     }
 }