예제 #1
0
 /**
  * @param AJKRequest $request
  * @param array $out
  * @throws Exception
  */
 public static function initEnv($request, &$out)
 {
     $out['debug'] = isset($_GET['debug']) ? true : false;
     $out['cityId'] = $request->getBrokerCityId();
     $out['ajkBrokerId'] = $request->getBrokerId();
     $brokerInfo = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerIdEx($out['ajkBrokerId']);
     if (empty($brokerInfo)) {
         throw new Exception('获取金铺经纪人信息失败:ajkBrokerId [' . $out['ajkBrokerId'] . ']');
     }
     $out['brokerInfo'] = $brokerInfo;
     // 获取金铺brokerId
     $out['jpBrokerId'] = $brokerInfo['id'];
     // 是否精选
     $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::JINPU);
     $out['isBidCity'] = false;
     $out['isShowCaseCity'] = Bll_City::isShowCaseCity($out['cityId'], Const_Site::JINPU);
     $out['bidTip'] = '精选';
     //经纪人全部有效房源
     $out['houses'] = Bll_House_JpHouseInfo::getAllHouseInfoEx($out['ajkBrokerId']);
     $out['houseIds'] = array();
     foreach ($out['houses'] as $infoP) {
         $base = $infoP['base'];
         $info = $infoP['info'];
         $type = $infoP['houseType'];
         $propertyId = in_array($type, array(1, 2)) ? $info['buildingId'] : $info['propertyId'];
         $out['houseIds'][$type][$base['id']] = array('houseId' => $base['id'], 'propertyId' => $propertyId);
     }
     $out['publishUrl'] = Bll_Broker_Combo_ManageJp::buildHousePublishUrl();
 }