public function handle_request_internal() { $request = APF::get_instance()->get_request(); $brokerId = self::$BrokerInfo['BaseInfo']['BROKERID']; $cityId = self::$BrokerInfo['BaseInfo']['CITYID']; try { $starBll = new Bll_Broker_StarIntermediary($cityId); $starIsOpen = $starBll->checkCityIfOpen(); if ($starIsOpen) { $starInfo = $starBll->getBrokerNewestInfo($brokerId); $brokerScore = $starInfo['broker']['brokerScore'] ?: 0; $maxScore = $starInfo['city']['cityScore'] ?: 0; $leftScore = $maxScore - $brokerScore > 0 ? $maxScore - $brokerScore : 0; $clickScoreRate = sprintf("%.1f", $starInfo['city']['vppvBeishu'] ?: 0); $isStar = $starInfo['broker']['isMingxing'] ?: 0; $request->set_attribute('brokerScore', $brokerScore); $request->set_attribute('maxScore', $maxScore); $request->set_attribute('leftScore', $leftScore); $request->set_attribute('clickScoreRate', $clickScoreRate); $request->set_attribute('isStar', $isStar); } else { //todo 产品没有定义错误页面,工期太赶,没有时间处理 return; } } catch (Exception $e) { //todo 不做任何处理 return; } return "Broker_StarIntermediary"; }
public function get_view() { //城市id $CityId = $this->get_param("CityId"); //域名拼装 $city_set = APF::get_instance()->get_config("city_set", "multicity"); $base_domain = APF::get_instance()->get_config("anjuke_base_domain"); $this->assign_data("ajkBaseDomain", "http://my." . $base_domain); //获取uri路径 $uri = APF::get_instance()->get_request()->get_request_uri(); $this->assign_data("uri", $uri); $this->assign_data("CityUriPrefix", "http://" . $city_set[$CityId]['pinyin'] . "." . $base_domain); //设置商业地产商铺,楼盘专业度城市列表 $this->set_city_list(); $this->cityId = $CityId; //明星中介相关 try { apf_require_class('Bll_Broker_StarIntermediary'); $starBll = new Bll_Broker_StarIntermediary($CityId); $this->starIsOpen = $starBll->checkCityIfOpen(); $brokerId = APF::get_instance()->get_request()->getBrokerId(); $starInfo = $starBll->getBrokerNewestInfo($brokerId); if (empty($starInfo['broker'])) { $this->starIsOpen = 0; } } catch (Exception $e) { //todo 不做任何处理,不展示明星中介内容 } return "BrokerShareHeader"; }
public function get_view() { $params = $this->get_params(); $this->assign_data('menu', $params['menu']); $this->assign_data('index', $params['index']); //添加商业地产店铺城市列表 $this->set_city_list(); $this->assign_data('managespace_city_list', $this->managespace_city_list); $request = APF::get_instance()->get_request(); $cityId = $request->getBrokerCityId(); $this->assign_data('cityId', $cityId); $this->assign_data('isNewCommunityApplyCity', Bll_City::isNewCommunityApplyCity($cityId)); //明星中介相关 try { apf_require_class('Bll_Broker_StarIntermediary'); $starBll = new Bll_Broker_StarIntermediary($cityId); $starIsOpen = $starBll->checkCityIfOpen(); $brokerId = APF::get_instance()->get_request()->getBrokerId(); $starInfo = $starBll->getBrokerNewestInfo($brokerId); if (empty($starInfo['broker'])) { $starIsOpen = 0; } $this->assign_data('starIsOpen', $starIsOpen); } catch (Exception $e) { //todo 不做任何处理,不展示明星中介内容 } return "BrokerSideNav"; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $app = $this->_params['app']; $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$brokerInfo) { throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS); } /** 获取经纪人被关注的人数 */ $brokerChatId = Model_Mobile_BrokerChatInfo::getBrokerChatInfo($brokerId, array('chatId')); $followerNum = 0; if ($brokerChatId['chatId']) { $followerNumInfo = Bll_Mobile_ChatInfoBll::getBrokerFollowerNum($brokerChatId['chatId']); if ($followerNumInfo['data']['status'] == 'OK') { $followerNum = $followerNumInfo['data']['result']['focus_count']; } } $analysis = Bll_Broker_CallAnalysis::getBrokerAnalysis($brokerId); $balanceInfo = Bll_Service_Payment::balance(Bll_Service_Payment::SITE_ANJUKE, array('userId' => Bll_Broker_MainBusiness::getDataByEsfId($brokerId)->memberId)); $managerInfo = Bll_Broker::getWorkerNumInfo($brokerId); // 微聊达人 $isTalent = -1; // 默认,微聊活动未开始或已结束 if (Bll_Broker_CallAnalysis::isTalentEventOngoing()) { $isTalent = 0; // 活动中,默认不是微聊达人 if ($analysis) { $isTalent = $analysis['isTalent']; } } $talentIcon = Bll_Broker_CallAnalysis::getTalentIcon($isTalent, $app); // 明星经纪人 $isStarBroker = 0; $starBrokerIcon = ''; try { $bllStarBroker = new Bll_Broker_StarIntermediary($brokerInfo['cityId']); $starBrokerInfo = $bllStarBroker->getBrokerNewestInfo($brokerId); if ($starBrokerInfo && $starBrokerInfo['broker']['isMingxing']) { $isStarBroker = 1; $starBrokerIcon = PageHelper::pure_static_url('/img/mobile/app/star_broker.png'); } } catch (Exception $e) { // do nothing } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('replyRate' => $analysis['reply5minRate'] * 100, 'responseTime' => $analysis['avgRespondTime'], 'customNum' => $analysis['accChatUser'], 'loginDays' => $analysis['accLoginDays'], 'isTalent' => $isTalent, 'talentIcon' => $talentIcon, 'isStarBroker' => $isStarBroker, 'starBrokerIcon' => $starBrokerIcon, 'ajkContact' => $managerInfo['userName'], 'balance' => empty($balanceInfo['data']['balance']) ? 0 : round($balanceInfo['data']['balance'] / 100, 2), 'tel' => $managerInfo['mobile'], 'followerNum' => $followerNum)); }