Esempio n. 1
0
 public function handle_request_internal()
 {
     $request = APF::get_instance()->get_request();
     $params = $request->get_parameters();
     $brokerId = self::$BrokerInfo['BaseInfo']['BROKERID'];
     if ($params['site'] == 'jp') {
         //金铺逻辑
         $jpMember = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($brokerId);
         $jpMemberId = intval($jpMember->id);
         $this->response(BLL_House_JpProperty::getJpLibrary($params, $jpMemberId));
     } elseif ($params['site'] == 'hz') {
         //租房逻辑
     } else {
         //二手房房逻辑
     }
 }
Esempio n. 2
0
 public function handle_request_internal()
 {
     $request = APF::get_instance()->get_request();
     $params = $request->get_parameters();
     $pid = intval($params['id']);
     if (isset($params['id'])) {
         $propertyInfo = BLL_House_JpProperty::getProperty($pid);
         if ($propertyInfo) {
             $u_company = trim($params['com']);
             $BuildingScore = Model_House_JpBuildingScore::data_access()->filter(Model_House_JpBuildingScore::BUILDING_ID, $pid)->find();
             //获取物业的完善度等级
             $completion = BLL_House_JpProperty::getBuildingComplationByBuildingId($pid, 'all');
             if ($completion !== false) {
                 $completionLevel = BLL_House_JpProperty::getCompletionLevel($pid, $propertyInfo->cityId);
             } else {
                 $completionLevel = 0;
             }
             if ($propertyInfo->propertyCompany != $u_company) {
                 $l_property = new Model_Jinpu_PropertyAudit();
                 $l_property->buildingId = $pid;
                 $l_property->cityId = $propertyInfo->cityId;
                 $l_property->memberId = $request->getBrokerId();
                 $l_property->createTime = date("Y-m-d H:i:s");
                 $l_property->fieldName = json_encode(array('table' => 'e_building', 'field' => 'property_company', 'index' => ""));
                 $l_property->value = $u_company;
                 $l_property->rawValue = $propertyInfo->propertyCompany;
                 if (!empty($BuildingScore) || $completionLevel == 1) {
                     $l_property->campaignType = 1;
                 }
                 $l_property->completionLevel = $completionLevel;
                 $l_property->isAdd = isset($propertyInfo->propertyCompany) && $propertyInfo->propertyCompany ? 0 : 1;
                 $l_property->save();
                 unset($l_property);
             }
             APF::get_instance()->get_response()->set_content_type('application/json', 'utf-8');
             echo json_encode(array('data' => array('status' => "succ")));
             exit;
         }
     }
     return false;
 }
Esempio n. 3
0
 /**
  * @param $request object
  * @param $brokerInfo array
  * @param $type string rent || sale
  * @return array
  */
 public static function getShopBeforePost($request, $brokerInfo, $type)
 {
     $out = $logGiveArr = array();
     $params = $request->get_parameters();
     // manager_id不为空,说明是伪登录
     $out['managerId'] = $request->get_cookie('manager_id');
     // 经纪人信息
     $out['brokerInfo'] = $brokerInfo;
     $cityId = $brokerInfo['CITYID'];
     //金铺城市ID转换
     $jpCityId = $out['brokerInfo']['jpCityId'] = BLL_House_JpHouseManage::getMemberCityId($cityId);
     $out['ajkBrokerId'] = $out['brokerInfo']['BROKERID'];
     $jpMember = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($out['ajkBrokerId']);
     $out['brokerInfo']['jpMemberId'] = intval($jpMember->id);
     //获取城市配置信息是否是精选推广
     $out['isChoiceCity'] = Bll_City::isChoiceCity($jpCityId, Const_Site::JINPU);
     $out['bidTip'] = $out['isChoiceCity'] ? '精选' : '竞价';
     //是否套餐经纪人
     $out['isCombo'] = $brokerInfo['PAYTYPE'] == 9999 ? 1 : 0;
     //套餐城市是否显示推广按钮,以及提示
     $out['spreadFlagInfo'] = array('spreadFlag' => 1, 'info' => '');
     if ($out['isCombo']) {
         $comboCheck = Bll_Combo_HouseRelation::housePublishComboCheck($out['ajkBrokerId'], $cityId, Bll_Combo_HouseRelation::SITE_TYPE_JP);
         if ($comboCheck['status'] != 1) {
             $out['spreadFlagInfo'] = array('spreadFlag' => 0, 'info' => $comboCheck['msg']);
         }
     }
     // 获取全部图片分类信息(用于编辑时候默认展示分类情况)
     $arrCategory = array();
     $arrAllCates = Model_Image_Category::get_img_cates_by_type('shop');
     $arrCategory['all'] = $arrAllCates;
     $arrCategory['classify'] = array_fill_keys(array_keys($arrAllCates), 0);
     $out['arrCategory'] = $arrCategory;
     // 描述引导
     $out['descGuide'] = self::getShopDescGuideTitle($type);
     //编辑图片,用于展示退回照片模块
     $out['editPic'] = $params['edit_pic'];
     //北上广深 四城市
     $citySpecial = array('13', '14');
     $out['priceType'] = in_array($jpCityId, $citySpecial) ? 1 : 0;
     $out['isPost'] = $request->is_post_method();
     if ($type == 'rent') {
         //交租方式
         $out['rentModeFirst'] = Model_House_JpShopRent::getRentModeFirst();
         $out['rentModeSecond'] = Model_House_JpShopRent::getRentModeSecond();
     }
     //---------是否编辑---------------//
     $shopInfo = array();
     $shopId = 0;
     $propertyId = 0;
     // 初始化参数
     $matches = $request->get_router_matches();
     if (isset($matches[2]) && !empty($matches[2])) {
         $shopId = intval($matches[2]);
         $shopInfo = $type == 'rent' ? Model_House_JpShopRent::getPropInfoById($shopId) : Model_House_JpShopSale::getPropInfoById($shopId);
         $propertyId = $shopInfo['propertyId'];
     }
     $out['isEdit'] = empty($shopInfo) ? 0 : 1;
     //四选一弹层
     $out['bolFlag'] = $out['isEdit'] || !isset($params['from']) ? 0 : 1;
     $out['shopInfo'] = $shopInfo;
     $out['shopId'] = $shopId;
     if (!$out['isCombo']) {
         $planInfo = BLL_House_JpHouseManage::getFixPlanInfo($shopId);
         if ($out['isEdit'] && $planInfo['success'] && $planInfo['data']['status'] == 3) {
             //定价计划状态为3,不可编辑
             return array('status' => 'error', 'errCode' => Const_PublishCode::UNKNOWN_ERROR);
         }
     }
     //新发,需要验证房源发布套数限制
     if (!$out['isEdit']) {
         if (BLL_House_JpHouseManage::houseNumLimit($out['brokerInfo']['jpMemberId'], $out['ajkBrokerId'], true)) {
             //保存漏斗日志
             if ($out['isPost']) {
                 $houseType = Bll_Loudou_Log::jinpuHouseType('shop', $type);
                 $str = '';
                 switch ($params['goto_next_step']) {
                     case 'planCombo':
                     case 'planFix':
                         $str = Bll_Loudou_Log::RESULT_TYPE_FIX_FAILED_OTHERS;
                         break;
                     case 'justSaveHouse':
                         $str = Bll_Loudou_Log::RESULT_TYPE_SAVE_FAILED_HOUSE_MAX_LIMIT;
                         break;
                 }
                 $logGiveArr[] = array('func' => array('Bll_Loudou_log', 'add'), 'params' => array($houseType, $str, Bll_Loudou_Log::SOURCE_TYPE_FORM));
             }
             return array('status' => 'error', 'errCode' => Const_PublishCode::PUBLISH_OUT_OF_LIMIT);
         }
     }
     //经营信息模块的配置信息
     list($out['enumShopType'], $out['enumShopMatching'], $out['enumShopIndustry'], $out['enumShopIndustryLimit'], $out['enumShopPassengerType']) = BLL_House_JpProperty::getShopEnum();
     //页面精品房源url
     $out['exquisiteUrl'] = BLL_Plan_JpPlanUrl::buildHelpUrl('1026');
     //页面经典范例url
     $out['exampleTitleUrl'] = BLL_Plan_JpPlanUrl::buildHelpUrl('1044');
     //页面房源描述下方经典范例url
     $out['exampleDescUrl'] = BLL_Plan_JpPlanUrl::buildHelpUrl('1045');
     //房源发布协议url
     $out['contractUrl'] = BLL_Plan_JpPlanUrl::buildHelpUrl('554');
     //房源PPC价格段信息
     $out['ppcInfo'] = Bll_Plan_JpPlanManage::getInstance()->getPPCPrice($jpCityId, $type == 'rent' ? 3 : 4);
     //城市区域列表,选择区域使用
     $out['districts'] = Model_Jinpu_District::getCityDistricts($jpCityId);
     //经纪人定价推广组信息
     $out['fixPlanInfo'] = $out['isCombo'] ? array() : Bll_Plan_JpPlanManage::getInstance()->getBrokerFixPlans($out['brokerInfo']['jpMemberId']);
     if ($out['isEdit']) {
         //编辑状态下的特殊信息
         //编辑 验证房源是否属于经纪人
         if ($out['brokerInfo']['jpMemberId'] != $out['shopInfo']['memberId']) {
             return array('status' => 'error', 'errCode' => Const_PublishCode::NOT_OWN_HOUSE);
         }
         //房源交租方式(付一押一)
         list($out['rentModelFirst'], $out['rentModelSecond']) = explode(',', $shopInfo['rentMode']);
         //单层 多层 独栋
         $out['floorType'] = 1;
         if ($shopInfo['isFullFloor']) {
             $out['floorType'] = 3;
         } elseif ($shopInfo['upFloor']) {
             $out['floorType'] = 2;
         }
         //房源推广信息,被编辑的房源是否在推广中
         $houseCanSpread = 1;
         if ($out['isCombo']) {
             $houseCombo = Model_Combo_HouseRelation::getOnlineHousebyHouseId($out['ajkBrokerId'], $shopId, $cityId, Model_Combo_HouseRelation::SITE_TYPE_JP);
             if (!empty($houseCombo)) {
                 $houseCanSpread = 0;
             }
         } else {
             $shopIdx = Model_House_JpHouseIdx::data_access()->filter('id', $shopId)->get_row();
             if (!empty($shopIdx['fixSpreadId'])) {
                 $houseCanSpread = 0;
             }
         }
         $out['houseCanSpread'] = $houseCanSpread;
         //图片退回信息
         $out['backRows'] = array();
         if ($shopId && $out['isEdit']) {
             $out['backRows'] = Bll_Image_JpHouseImage::getBackRows($shopId, $type == 'rent' ? 3 : 4);
         }
         //房源描述
         $desc = $type == 'rent' ? Model_Jinpu_ShopRentDesc::getByPk($shopId) : Model_Jinpu_ShopSaleDesc::getByPk($shopId);
         $out['shopDesc'] = $desc['desc'];
         //房源物业信息
         $out['propertyData'] = $propertyData = (array) BLL_House_JpProperty::getProperty($shopInfo['propertyId']);
         if (!$propertyData) {
             return array('status' => 'error', 'errCode' => Const_PublishCode::NOT_OWN_HOUSE);
         }
         if ($propertyData['isRoad'] == 1 && ($shopInfo['districtId'] || !$shopInfo['blockId'])) {
             $out['forceBlockEdit'] = true;
         } elseif ($propertyData['isRoad'] == 0 && (!$propertyData['districtId'] || !$propertyData['blockId'])) {
             $out['forceBlockEdit'] = true;
         }
         if (!$out['forceBlockEdit']) {
             //逻辑好多啊 妹子的
             $districtIdForSearch = !$propertyData['isRoad'] ? $propertyData['districtId'] : $shopInfo['districtId'];
             $blockIdForSearch = !$propertyData['isRoad'] ? $propertyData['blockId'] : $shopInfo['blockId'];
             $districtInfo = Model_Jinpu_District::data_access()->filter('id', $districtIdForSearch)->get_row();
             $districtName = $districtInfo['is_actived'] == 1 ? $districtInfo['name'] : '';
             $blockInfo = Model_Jinpu_Block::data_access()->filter('id', $blockIdForSearch)->get_row();
             $blockName = $blockInfo['isActived'] == 1 ? $blockInfo['name'] : '';
             $titleStr = $districtName . ' ' . $blockName . ' ' . (!$propertyData['isRoad'] ? $propertyData['address'] : '') . (!empty($shopInfo['closeRoad']) ? '靠近:' . $shopInfo['closeRoad'] : '');
             $showStr = strlen($titleStr) > 90 ? Util_GlobalFunc::cutchar($titleStr, 28) : $titleStr;
             $out['titleStr'] = $titleStr;
             $out['showStr'] = $showStr;
         }
         $out['hasLibrary'] = BLL_House_JpProperty::hasLibrary($out['brokerInfo']['jpMemberId'], $shopInfo['propertyId'], 'property');
         //房源图片查询和排序
         $images = self::handleShopImages($shopId, $type);
         //个人图库图片是否被锁定
         foreach ($images as $key => $imgVal) {
             $imgVal['isLock'] = 0;
             if ($imgVal && $imgVal['personalImgId']) {
                 $personalImg = Model_Jinpu_PersonalGallery::getImgById($imgVal['personalImgId']);
                 if ($personalImg && $personalImg->category) {
                     $imgVal['isLock'] = 1;
                 }
             }
             if ($imgVal['category'] && isset($out['arrCategory']['classify'][intval($imgVal['category'])])) {
                 $out['arrCategory']['classify'][intval($imgVal['category'])] += 1;
             }
             $images[$key] = $imgVal;
         }
         $out['images'] = $images;
     }
     $lng = $lat = $mapDataFlag = 0;
     //地图标注商铺位置的逻辑
     $DShopMap = Model_Jinpu_MapShop::getByPK($shopId);
     if (!empty($DShopMap)) {
         $lng = $DShopMap['lng'];
         $lat = $DShopMap['lat'];
         $mapDataFlag = 1;
     } else {
         if ($propertyId > 0) {
             $shopLocation = Model_Jinpu_MapProperty::getPropertyMapById($propertyId);
             if (!empty($shopLocation)) {
                 $lng = $shopLocation['lng'];
                 $lat = $shopLocation['lat'];
             }
         } else {
             list($lng, $lat) = BLL_House_JpHouseManage::getDefaultMap($out['brokerInfo']['CITYID']);
         }
         $mapDataFlag = 0;
     }
     $out['lng'] = $lng;
     $out['lat'] = $lat;
     $out['mapDataFlag'] = $mapDataFlag;
     return array('status' => 'ok', 'info' => $out, 'logArr' => $logGiveArr);
 }
Esempio n. 4
0
 /**
  * @param $cityId
  * @param $q
  * @param $pb
  * @param int $limit
  * @param int $memberId
  * @return mixed
  */
 public static function getJpSearchProperty($cityId, $q, $pb, $memberId, $limit = 0)
 {
     $limit = $limit > 0 ? $limit : 10;
     $solr = '';
     if ($pb == 'building') {
         $solr = new Solr_SolrList('solrJpBuildingServer', true, false);
     } elseif ($pb == 'property') {
         $solr = new Solr_SolrList('solrJpPropertyServer', true, false);
     }
     $buildings = array();
     $solr->set_row($limit);
     $solr->set_q($q);
     $solr->set_fq('city_id:' . $cityId);
     if ($pb == 'property') {
         $solr->set_sort('is_spider asc,type asc');
     }
     $url = $solr->get_lucene_uri('', false, false);
     $json_data = $solr->get_result_from_lucene($url);
     $solrData = Solr_SolrList::get_properties($json_data);
     $solrIds = array();
     foreach ($solrData as $solr) {
         $solrIds[] = $solr['id'];
     }
     //var_dump($solrIds);die;
     if (!empty($solrIds)) {
         $temp = array();
         if ($pb == 'building') {
             $temp = Model_House_JpBuilding::data_access()->filter(Model_House_JpBuilding::ID, $solrIds)->filter(Model_House_JpBuilding::IS_ACTIVED, Model_House_JpBuilding::ENUM_IS_ACTIVED_YES)->limit($limit)->get_all();
         } elseif ($pb == 'property') {
             $temp = Model_House_JpProperty::data_access()->filter('id', $solrIds)->filter('isActived', Model_House_JpProperty::ENUM_IS_ACTIVED_YES)->sort('isSpider')->limit($limit)->get_all();
         }
         $cityIds = $districtIds = $blockIds = array();
         foreach ($temp as $tmp) {
             $cityIds[] = $tmp['cityId'];
             $districtIds[] = $tmp['districtId'];
             $blockIds[] = $tmp['blockId'];
         }
         $cityIds = array_unique($cityIds);
         $districtIds = array_unique($districtIds);
         $blockIds = array_unique($blockIds);
         $citys = $districts = $blocks = array();
         if ($cityIds) {
             $citysT = Model_Jinpu_City::data_access()->filter('id', $cityIds)->get_all();
             foreach ($citysT as $c) {
                 $citys[$c['id']] = $c['name'];
             }
         }
         if ($districts) {
             $districtsT = Model_Jinpu_District::data_access()->filter('id', $districtIds)->get_all();
             foreach ($districtsT as $d) {
                 $districts[$d['id']] = $d['name'];
             }
         }
         if ($blockIds) {
             $blocksT = Model_Jinpu_Block::data_access()->filter('id', $blockIds)->get_all();
             foreach ($blocksT as $d) {
                 $blocks[$d['id']] = $d['name'];
             }
         }
         foreach ($temp as $b) {
             $allLock = BLL_House_JpProperty::getBuildingLockById($b['id']);
             $buildings[] = array('id' => $b['id'], 'district_id' => $b['districtId'], 'block_id' => $b['blockId'], 'name' => $b['name'] . ($pb == 'property' ? '商铺' : ''), 'city' => empty($citys[$b['cityId']]) ? '' : $citys[$b['cityId']], 'district' => empty($districts[$b['districtId']]) ? '' : $districts[$b['districtId']], 'block' => empty($blocks[$b['blockId']]) ? '' : $blocks[$b['blockId']], 'business_cycle' => empty($b['businessCycle']) ? '' : $b['businessCycle'], 'address' => empty($b['address']) ? '' : $b['address'], 'manage_fee' => empty($b['manageFee']) ? '' : $b['manageFee'], 'property_company' => $b['propertyCompany'], 'has_uploaded_image' => BLL_House_JpProperty::hasLibrary($memberId, $b['id'], $pb), 'property_company_lock' => isset($allLock['property_company']) && $allLock['property_company'] || $b['isNew'] ? 1 : 0);
         }
     }
     return $buildings;
 }
Esempio n. 5
0
 /**
  * 获取区域板块
  * @static
  * @param $p_intHouseType
  * @param $p_objHouse
  * @return array|bool
  */
 public static function getDistrictBlock($p_intHouseType, $p_objHouse)
 {
     $p_intHouseType = intval($p_intHouseType);
     //获取区域板块编号
     $intDistrictId = 0;
     $intBlockId = 0;
     if (in_array($p_intHouseType, array(1, 2))) {
         $objBuilding = BLL_House_JpProperty::getBuilding($p_objHouse->building_id);
         if ($objBuilding == null) {
             $objBuilding = BLL_House_JpProperty::getProperty($p_objHouse->building_id);
             if ($objBuilding == null) {
                 return false;
             }
         }
         $intBlockId = $objBuilding->blockId;
         $intDistrictId = $objBuilding->districtId;
     } else {
         $objProperty = BLL_House_JpProperty::getProperty($p_objHouse->property_id);
         if (!$objProperty instanceof Model_House_JpProperty) {
             return false;
         }
         if ($objProperty->isRoad == 1) {
             $intBlockId = $p_objHouse->blockId;
             $intDistrictId = $p_objHouse->districtId;
         } else {
             $intBlockId = $objProperty->blockId;
             $intDistrictId = $objProperty->districtId;
         }
     }
     $district_data = Bll_AreaBll::get_instance()->getDistrict_b($intDistrictId);
     $block_data = Bll_AreaBll::get_instance()->getBlock_b($intBlockId);
     if (isset($district_data) && isset($block_data) && $district_data && $block_data) {
         $district_name = $district_data->name;
         $block_name = $block_data->name;
         $district_pinyin = $district_data->pinyin;
         $bolck_pinyin = $block_data->pinyin;
     } else {
         $district_name = '';
         $block_name = '';
         $district_pinyin = '';
         $bolck_pinyin = '';
     }
     $arrData = array('district_id' => $intDistrictId, 'district_name' => $district_name, 'district_pinyin' => $district_pinyin, 'block_id' => $intBlockId, 'block_name' => $block_name, 'block_pinyin' => $bolck_pinyin);
     //判断和获取新板块
     $arrBlockConfigs = array('1' => 'clues_search_condition_office_rent_list_switch', '2' => 'clues_search_condition_office_sale_list_switch', '3' => 'clues_search_condition_shop_rent_list_switch', '4' => 'clues_search_condition_shop_sale_list_switch');
     $strBlockConfig = isset($arrBlockConfigs[$p_intHouseType]) ? $arrBlockConfigs[$p_intHouseType] : array();
     if (empty($strBlockConfig)) {
         return $arrData;
     }
     $arrBlockConfig = APF::get_instance()->get_config($strBlockConfig, 'multicity');
     $intCityId = $p_objHouse->city_id;
     $bolUseNewBlock = isset($arrBlockConfig[$intCityId]) ? $arrBlockConfig[$intCityId] : false;
     if ($bolUseNewBlock) {
         $arrHouseType = array('1' => 'office_rent', '2' => 'office_sale', '3' => 'shop_rent', '4' => 'shop_sale');
         $strHouseType = isset($arrHouseType[$p_intHouseType]) ? $arrHouseType[$p_intHouseType] : '';
         if (empty($strHouseType)) {
             return $arrData;
         }
         if (in_array($p_intHouseType, array(1, 2))) {
             $arrResult = Bll_AreaBll::get_instance()->get_new_district_business_by_old_block($intBlockId, $strHouseType);
         } else {
             $arrResult = Bll_AreaBll::get_instance()->get_new_district_business_by_old_block_shop($intBlockId, $strHouseType);
         }
         if (isset($arrResult['new_district_id']) && !empty($arrResult['new_district_id'])) {
             $arrData['new_district_id'] = intval($arrResult['new_district_id']);
             $arrData['new_district_name'] = $arrResult['new_district_name'];
             $arrData['new_district_pinyin'] = $arrResult['new_district_pinyin'];
         }
         if (isset($arrResult['new_business_id']) && !empty($arrResult['new_business_id'])) {
             $arrData['new_business_id'] = intval($arrResult['new_business_id']);
             $arrData['new_business_name'] = $arrResult['new_business_name'];
             $arrData['new_business_pinyin'] = $arrResult['new_business_pinyin'];
         }
     }
     return $arrData;
 }
Esempio n. 6
0
 /**
  * @param $params
  * @param $jpMemberId
  * @return array
  */
 public static function getJpLibrary($params, $jpMemberId)
 {
     $order_field = intval($params['order_field']) > 0 ? 'category' : 'update_time';
     $order_sort = intval($params['order_sort']) > 0 ? 'desc' : 'asc';
     $category = isset($params['category']) ? $params['category'] : 0;
     $buildingId = intval($params['bi']);
     $publicImages = array();
     if ($category == 0) {
         $publicImages = self::getBuildingImg($buildingId);
     }
     //office
     $house_type = false;
     $arrAllCates = Model_Image_Category::get_img_cates_by_type('office');
     //shop
     if ($params['ao'] == 1) {
         $house_type = true;
         $arrAllCates = Model_Image_Category::get_img_cates_by_type('shop');
     }
     $imgs = self::listGallery($jpMemberId, $buildingId, $category, $house_type, $order_field, $order_sort, 20);
     if (empty($imgs) && empty($publicImages)) {
         $return = array();
     } else {
         $re1 = array();
         if (!empty($publicImages)) {
             foreach ($publicImages as $img) {
                 $temp = array();
                 $temp['url'] = BLL_House_JpProperty::build_img_url($img['hostId'], $img['key'], 400, 300);
                 $temp['name'] = '来自公共图库';
                 $temp['type'] = 5;
                 $temp['selected'] = false;
                 $temp['id'] = $img['key'];
                 $temp['key'] = $img['key'];
                 $temp['hostId'] = $img['hostId'];
                 $temp['imgWidth'] = $img['imgWidth'];
                 $temp['imgHeight'] = $img['imgHeight'];
                 $temp['imgSize'] = $img['imgSize'];
                 $temp['public'] = 1;
                 $temp['pid'] = $img['id'];
                 //公共图库表自增长ID
                 $re1[] = $temp;
             }
         }
         $re2 = array();
         if (!empty($imgs)) {
             foreach ($imgs as $img) {
                 $temp = array();
                 $temp['url'] = BLL_House_JpProperty::build_img_url($img['host_id'], $img['key'], 400, 300);
                 $temp['name'] = $arrAllCates[$img['category']];
                 $temp['type'] = $img['category'];
                 $temp['selected'] = false;
                 $temp['key'] = $img['key'];
                 $temp['id'] = $img['key'];
                 $temp['hostId'] = $img['host_id'];
                 $temp['category'] = $img['category'];
                 $temp['imgWidth'] = $img['width'];
                 $temp['imgHeight'] = $img['height'];
                 $temp['imgSize'] = $img['size'];
                 $temp['public'] = 0;
                 $temp['gid'] = $img['id'];
                 //公共图库表自增长ID
                 $re2[] = $temp;
             }
         }
         $return = array_merge($re1, $re2);
     }
     return $return;
 }
Esempio n. 7
0
 /**
  * 添加数据的其他信息
  */
 public static function formatData($data)
 {
     $city_name_config = APF::get_instance()->get_config('name', 'multicity');
     if ($data) {
         foreach ($data as $key => $info) {
             if (isset($info['property_id'])) {
                 //todo 验证楼盘有效性并获取楼盘名称
                 $objProperty = BLL_House_JpProperty::getProperty($info['property_id']);
                 if ($objProperty) {
                     $data[$key]['property_name'] = $objProperty->name;
                 }
             }
             if (isset($info['block_id'])) {
                 $block_data = BLL_House_JpProperty::getBlockB($info['block_id']);
                 if ($block_data) {
                     $data[$key]['block_name'] = $block_data->name;
                 }
                 //todo 获取板块名称
             }
             if (isset($info['district_id'])) {
                 $district_data = BLL_House_JpProperty::getDistrictB($info['district_id']);
                 if ($district_data) {
                     $data[$key]['district_name'] = $district_data->name;
                 }
                 //todo 获取区域名称
             }
             if (isset($info['city_id'])) {
                 $data[$key]['city_name'] = $city_name_config[$info['city_id']];
                 //获取城市名称
             }
         }
     }
     return $data;
 }
Esempio n. 8
0
 /**
  * @param $buildingId
  * @return array|mixed|null
  * @throws Exception
  */
 public static function getBuildingInfo($buildingId)
 {
     $DBuilding = (array) BLL_House_JpProperty::getProperty($buildingId);
     if (!$DBuilding) {
         return false;
     }
     $HBuilding = Model_House_JpBuilding::data_access()->filter(Model_House_JpBuilding::ID, $DBuilding['id'])->get_row();
     $DBuilding['manageFee'] = $HBuilding->manageFee;
     $cityInfo = Model_Jinpu_City::data_access()->filter(Model_Jinpu_City::ID, intval($DBuilding['cityId']))->get_row();
     $districtInfo = Model_Jinpu_District::data_access()->filter(Model_Jinpu_District::ID, intval($DBuilding['districtId']))->get_row();
     $blockInfo = Model_Jinpu_Block::data_access()->filter('id', intval($DBuilding['blockId']))->get_row();
     $DBuilding['cityName'] = $cityInfo['name'];
     $DBuilding['districtName'] = $districtInfo['name'];
     $DBuilding['cityName'] = $blockInfo['name'];
     return $DBuilding;
 }