public function handle_request_internal() { $brokerInfo = self::$BrokerInfo; $brokerId = $brokerInfo['BaseInfo']['BROKERID']; $dao = new DAO_My_Broker_Introduction(); $intro = $dao->getOneDataByBrokerId($brokerId); APF::get_instance()->get_request()->set_attribute('shopid', $intro['SHOPID']); //店铺一句话介绍 if (!empty($intro['SHOPNOTIC'])) { APF::get_instance()->get_request()->set_attribute('shopnotic', Util_PublicMethods::cutStr($intro['SHOPNOTIC'], 30, '')); } //店铺介绍 if (!empty($intro['SHOPNOTIC'])) { APF::get_instance()->get_request()->set_attribute('userintro', $intro['USERINTRO']); } APF::get_instance()->get_request()->set_attribute('CheckState', $brokerInfo['BaseInfo']['CHECKSTATE']); return "Broker_Introduction"; }
public function handle_request_abs() { $params = $this->getParameters(); $action = $params[self::ACTION]; if ($this->communityImageCount <= 0) { $this->setAttribute('isOk', 1); return 'Community_Gardener_PhotoCommitOk'; } $applyHistory = Bll_Community_CommunityGardener::getBrokerUnfinishedApply($this->communityId, static::$intBrokerID); $history = array(); if (!empty($applyHistory['applyData'])) { $history = json_decode($applyHistory['applyData'], true); } if ($action == 'save') { $image = array(); foreach ($params as $key => $val) { $kName = explode('_', $key); if (isset($kName[1]) && in_array($kName[0], array('host', 'hash', 'content'))) { if ($kName[0] == 'content') { $val = Util_PublicMethods::cutStr($val, 50); } $image[$kName[1]][$kName[0]] = $val; } else { continue; } } if ($image && count($image) >= $this->communityImageCount) { $history['images'] = array_values($image); Bll_Community_CommunityGardener::storeApplyCommunityCorrectData($this->communityId, static::$intBrokerID, $this->communityInfo['baseInfo']['cityId'], $history, Model_Community_GardenerApply::APPLY_STATUS_NOT_COMPLETE); if (Bll_Community_CommunityGardener::setCheckGardener($this->communityId, static::$intBrokerID)) { $this->setAttribute('isOk', 1); } else { $this->setAttribute('isOk', 2); } } else { $this->setAttribute('isOk', 2); } return 'Community_Gardener_PhotoCommitOk'; } $hasCorrectPhoto = !empty($history['images']); $this->setAttribute('hasCorrectPhoto', $hasCorrectPhoto); $this->setAttribute('brokerId', static::$intBrokerID); return 'Community_Gardener_PhotoCommit'; }
public function handle_request_internal() { $objRequest = APF::get_instance()->get_request(); $userId = $objRequest->getUserId(); if ($userId > 0) { $baseDomain = APF::get_instance()->get_config("base_domain"); $this->redirect("http://my." . $baseDomain . "/anjuke.html?_r=" . mt_rand(1000, time())); exit; } $cityDomain = Util_PublicMethods::getSecondDomain(); if ($cityDomain != 'my' && $cityDomain != 'agent') { $baseDomain = APF::get_instance()->get_config("base_domain"); $this->redirect("http://user." . $baseDomain . "/my/login"); exit; } $params = $objRequest->get_parameters(); //判断是否是好租中介跳转 if ($params['src'] == 'haozu') { APF::get_instance()->get_response()->set_cookie("src_haozu", 1, 86400); } $objRequest->set_attribute("history", $params["history"]); return 'Broker_Login'; }
public function handle_request_internal() { if (!Bll_City::isNewCommunityApplyCity(static::$intBrokerCityID)) { $this->redirect2Result(false, '非法请求', __LINE__); } $request = APF::get_instance()->get_request(); $params = $this->getParameters(); $verifyCode = $params[self::VERIFY]; $matches = $request->get_router_matches(); $communityId = intval($matches[1]); $brokerId = static::$intBrokerID; if ($verifyCode != Bll_Community_CommunityGardener::getVerifyCode($communityId, $brokerId)) { $this->redirect2Result(false, '请求不合法', __LINE__); } $communityInfo = Bll_Community_CommunityGardener::getCommunityDetail($communityId); if ($communityInfo['baseInfo']['typeFlag'] == 0) { $this->redirect2Result(false, '小区不存在', __LINE__); } if (!Bll_Community_CommunityGardener::checkCommunityCanApply($communityId, $brokerId, true)) { $this->redirect2Result(false, '小区不可以申请', __LINE__); } $communityGardenerApplyState = Bll_Community_CommunityGardener::getCommunityGardenerState($communityId); if (empty($communityGardenerApplyState)) { if (!Bll_Community_CommunityGardener::initCommunityGardenerState($communityId, $brokerId)) { $this->redirect2Result(false, '初始化小区状态失败', __LINE__); } } elseif ($communityGardenerApplyState['state'] == Model_Community_CommunityState::COMMUNITY_STATE_CHECKING) { $this->redirect2Result(false, '审核中的小区不允许申请', __LINE__); } elseif ($communityGardenerApplyState['state'] == Model_Community_CommunityState::COMMUNITY_STATE_APPLYING) { //状态为锁定 if ($communityGardenerApplyState['applyExpirationTime'] < time()) { //锁定时间过期 //重新锁定 if (!Bll_Community_CommunityGardener::lockCommunityGardenerApply($communityId, $brokerId)) { $this->redirect2Result(false, '锁定小区申请状态失败', __LINE__); } } else { //锁定时间未过期 //别人不能申请 if ($communityGardenerApplyState['applyBrokerId'] != $brokerId) { $this->redirect2Result(false, '小区正在被申请', __LINE__); } } } else { if (!Bll_Community_CommunityGardener::lockCommunityGardenerApply($communityId, $brokerId)) { $this->redirect2Result(false, '锁定小区申请状态失败', __LINE__); } } $action = $params[self::ACTION]; $applyHistory = Bll_Community_CommunityGardener::getBrokerUnfinishedApply($communityId, $brokerId); $history = array(); if (!empty($applyHistory) && !empty($applyHistory['applyData'])) { $history = json_decode($applyHistory['applyData'], true); } // $communityImageList = Bll_Community_CommunityGardener::getValidateCommunityImagesList($communityId); // $communityImageCount = count($communityImageList); // $brokerShouldUploadPhotoCount = max(0, Bll_Community_CommunityGardener::COMMUNITY_IMAGE_BASE_COUNT - $communityImageCount); $brokerShouldUploadPhotoCount = Bll_Community_CommunityGardener::COMMUNITY_IMAGE_BASE_COUNT; if ($action == 'save') { $image = array(); foreach ($params as $key => $val) { $keyName = explode('_', $key); if (isset($keyName[1]) && in_array($keyName[0], array('host', 'hash', 'content'))) { if ($keyName[0] == 'content') { $val = Util_PublicMethods::cutStr($val, 50); } $image[$keyName[1]][$keyName[0]] = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401 | ENT_IGNORE, 'UTF-8'); } else { continue; } } if (count($image) >= $brokerShouldUploadPhotoCount) { $uploadedImageList = array_values($image); $history['images'] = array_slice($uploadedImageList, 0, Bll_Community_CommunityGardener::COMMUNITY_IMAGE_COUNT_LIMIT); $storeSuccess = Bll_Community_CommunityGardener::storeApplyCommunityCorrectData($communityId, $brokerId, static::$intBrokerCityID, $history, Model_Community_GardenerApply::APPLY_STATUS_PENDING_APPROVAL); if ($storeSuccess) { Model_Community_CommunityState::setCheckGardener($communityId, $brokerId); $this->redirect2Result(true, '小区申请成功', __LINE__); } $this->redirect2Result(false, '保存图片信息失败', __LINE__); } $this->redirect2Result(false, '提交的图片数量不够', __LINE__); } $hasCorrectPhoto = !empty($history['images']); $this->setAttribute('brokerShouldUploadPhotoCount', $brokerShouldUploadPhotoCount); $this->setAttribute('brokerUploadPhotoCountLimit', Bll_Community_CommunityGardener::COMMUNITY_IMAGE_COUNT_LIMIT); $this->setAttribute('hasCorrectPhoto', $hasCorrectPhoto); $this->setAttribute('updatedImageList', isset($history['images']) ? $history['images'] : array()); $this->setAttribute('brokerId', $brokerId); $this->setAttribute('communityInfo', $communityInfo['baseInfo']); $this->setAttribute('verify', $verifyCode); return 'Community_Gardener2_PhotoCommit'; }
protected function get_chart_data_file($format = 1) { $end = time() - 86400; apf_require_class('Util_PublicMethods'); $end = Util_PublicMethods::convPeriod(time(), 2, $end, true); $begin = strtotime("-5 months", $end); apf_require_controller('Community_Chart_PriceTrends'); $url = Community_Chart_PriceTrendsController::build_url(date("Ym", $begin), date("Ym", $end), array($this->result_data['id']), null, $format); return $url; }
/** * 根据搜索引擎获取房源列表 * @param array $p_arrParameter * @param int $p_intPageNum * @param int $p_intPageSize * @return array */ static function getPropertyListBySearch($p_arrSearch, $p_intPageNum, $p_intPageSize) { apf_require_class('Search_RankSearch'); $objSearch = new Search_RankSearch(); if (isset($p_arrSearch['CITYID'])) { $objSearch->addAndCondition('CITY_ID', $p_arrSearch['CITYID']); } if (isset($p_arrSearch['AREACODE'])) { $objSearch->addAndCondition('AREA_CODE', $p_arrSearch['AREACODE']); } if (isset($p_arrSearch['STOREID'])) { $objSearch->addAndCondition('STOREID', $p_arrSearch['STOREID']); } if (isset($p_arrSearch['CREATIONDATE'])) { $objSearch->addOrCondition('creation_date', $p_arrSearch['CREATIONDATE']); } if (isset($p_arrSearch['SORT'])) { $objSearch->setSort($p_arrSearch['SORT']); } apf_require_class('Util_PublicMethods'); $arrPage = Util_PublicMethods::getSearchPage($p_intPageNum, $p_intPageSize); $objSearch->setStartNum(($arrPage['PAGENUM'] - 1) * $arrPage['PAGESIZE']); $objSearch->setFetchCnt($arrPage['PAGESIZE']); $arrProperty = $objSearch->getData(); $arrRS = array(); $arrRS['PAGER'] = $arrPage; $arrRS['PAGER']['TOTALNUM'] = $arrProperty['response']['numFound']; if (0 == $arrRS['PAGER']['TOTALNUM'] % $arrRS['PAGER']['PAGESIZE']) { $arrRS['PAGER']['TOTALPAGE'] = $arrRS['PAGER']['TOTALNUM'] / $arrRS['PAGER']['PAGESIZE']; } else { $arrRS['PAGER']['TOTALPAGE'] = floor($arrRS['PAGER']['TOTALNUM'] / $arrRS['PAGER']['PAGESIZE']) + 1; } if ($p_intPageNum > $arrRS['PAGER']['TOTALPAGE'] and $p_intPageNum > 1) { return self::getPropertyListBySearch($p_arrSearch, 1, $p_intPageSize); } $arrRS['DATA'] = $arrProperty['response']['docs']; return $arrRS; }
/** * 获取房源可优化项 * @param $propInfo * @param $imageInfo * @return array */ private static function getPropCanImproveItems($propInfo, $imageInfo) { $result = array(); // 图片check 至少3张室内 1张房型 1张小区 if (!(isset($imageInfo['roomImg']) && count($imageInfo['roomImg']) >= 3 && isset($imageInfo['moduleImg']) && count($imageInfo['moduleImg']) >= 1)) { $result['errorImage'] = true; } else { //pmt25312 20141210 caoyang 上海去除小区图检查 if (in_array($propInfo['cityid'], array(11)) || isset($imageInfo['commImg']) && count($imageInfo['commImg']) >= 1) { // $result['errorImage'] = false;//不显示 } else { $result['errorImage'] = true; } } // 房源日期较早 房源发布超过30天 if (floor((time() - $propInfo['created']) / 86400) > 30) { $result['errorTime'] = true; } // 房源描述 30字以内 $length = mb_strlen(Util_PublicMethods::clearHtml($propInfo['descript']), 'UTF-8'); if ($length < 30) { $result['errorDescript'] = true; } return $result; }