public function handle_request_internal() { $request = APF::get_instance()->get_request(); $response = APF::get_instance()->get_response(); $brokerId = $request->getBrokerId(); $clintHelper = Bll_Broker::getWorkerNumInfo($brokerId); $params = $this->getParameters(); if (!isset($params['err_no']) || empty($params['err_no'])) { $params['err_no'] = Bll_Plan_Bid_Choice::BID_FAIL_OTHER; } if ($params['err_no'] == Bll_Plan_Bid_Choice::BID_FAIL_OTHER && (!isset($params['err_msg']) || empty($params['err_msg']))) { $params['err_msg'] = '未知错误'; } $basicUrl = Util_Url::buildMyBasicUrl(); //新跳转页面 $specialRedirectUrl = $params['specialRedirectUrl']; $request->set_attribute('specialRedirectUrl', $specialRedirectUrl); $request->set_attribute('clintHelper', $clintHelper); $request->set_attribute('act', $params['act']); $request->set_attribute('err_msg', $params['err_msg']); $request->set_attribute('from', $params['from']); $request->set_attribute('err_no', $params['err_no']); $request->set_attribute('rank', $params['rank']); $request->set_attribute('params', $params['params']); $request->set_attribute('basicUrl', $basicUrl); $request->set_attribute('propId', $params['propId']); return "Choice_Result"; }
public function handle_request_internal() { $managerInfo = Bll_Broker::getWorkerNumInfo($this->_params['brokerId']); $r = array(); if (!empty($managerInfo)) { //调用java 接口获取客户主任 $return['brokerInfo']['saleManagerName'] = $managerInfo['userName'] ? $managerInfo['userName'] : "******"; $return['brokerInfo']['saleManagerTel'] = $managerInfo['mobile'] ? $managerInfo['mobile'] : ''; $r = array('status' => 'ok', 'data' => $return); } else { $return['brokerInfo']['saleManagerName'] = "400-620-9008"; $return['brokerInfo']['saleManagerTel'] = "4006209008"; $r = array('status' => 'ok', 'data' => $return); } return $r; }
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)); }
public function handle_request() { if ($this->_brokerId == 0) { echo sprintf('Usage: launcher.php Monitor_CheckBrokerHasCombo --broker=[:number:] [--site=[ajk|hz|jp]] [--release=...]'), PHP_EOL; return; } $this->logMsg('开始处理.....'); try { $userId = Bll_Broker::getBrokerUserIdByBrokerId($this->_brokerId); } catch (Exception $e) { $this->logMsg($e->getMessage()); return; } $brokerCurrentCombo = Model_Combo_ComboOrder::getBrokerCurrentCombo($userId, $this->_siteType); if (empty($brokerCurrentCombo)) { file_put_contents($this->_noComboBrokerLogFile, $this->_brokerId . PHP_EOL, FILE_APPEND); $this->logMsg('经纪人没有生效的套餐'); return; } $this->logMsg(sprintf('经纪人有生效的套餐:%s', json_encode($brokerCurrentCombo))); $this->logMsg('处理完成.....'); }
public function handle_request() { $cityIds = $this->getOption('city', array()); if (empty($cityIds)) { $this->logMsg('Usage: launcher.php Combo_AjkCheckHouseIsValidate --cityId=... [--release=...] '); return; } $cityIdList = explode(',', $cityIds); $dealCityIdList = array(); foreach ($cityIdList as $cityId) { if (false == Bll_City::isComboCity($cityId)) { $this->logMsg(sprintf('城市:%d 不是套餐城市,不予处理。', $cityId)); continue; } $dealCityIdList[] = $cityId; } $this->logMsg(sprintf('开始处理城市[%s]........', implode(',', $dealCityIdList))); $brokerList = Bll_Broker::scanComboBrokerByCityId($dealCityIdList, $this->_startId, self::BROKER_LIMIT); if (empty($brokerList)) { $this->logMsg(sprintf('startId: %d 没有获取到经纪人。', $this->_startId)); file_put_contents($this->_doneFile, 'YES'); return; } foreach ($brokerList as $broker) { $this->setCursor($broker['brokerId']); $onlineHouseRelationList = Bll_Combo_HouseRelation::getOnlineHouseList($broker['brokerId'], $broker['cityId'], Bll_Combo_HouseRelation::SITE_TYPE_AJK); /** 经纪人没有在线房源 */ if (empty($onlineHouseRelationList)) { $this->logMsg(sprintf('经纪人[%d]没有在线房源', $broker['brokerId'])); continue; } /** 获取在线房源ID */ $onlineHouseList = array(); foreach ($onlineHouseRelationList as $onlineHouseRelation) { $onlineHouseList[] = $onlineHouseRelation['houseId']; } $houseList = static::getInvalidateHouse($broker['cityId'], $broker['brokerId'], $onlineHouseList); /** 没有获取无效的房源信息 */ if (empty($houseList)) { $this->logMsg(sprintf('经纪人[%d]没有获取无效的房源[%s]信息', $broker['brokerId'], implode(',', $onlineHouseList))); continue; } foreach ($houseList as $house) { $this->logMsg(sprintf('房源[%d] brokerId=%d operateState=%d isVisible=%d expireWorker=%s updatedDatetime=%s', $house['proId'], $house['brokerId'], $house['operateState'], $house['isVisible'], $house['expireWorker'], $house['updatedDatetime'])); $effectRowCount = Bll_Combo_HouseRelation::updateHouseComboSpreadState($house['brokerId'], $house['proId'], Bll_Combo_HouseRelation::SITE_TYPE_AJK, Model_Combo_HouseRelation::ENUM_HOUSE_DELETE); if ($effectRowCount != 1) { $this->logMsg(sprintf('房源[%d] 更新关系失败', $house['proId'])); continue; } /** 通知用户端下架房源 */ $apiResponse = Bll_Combo_NoticeSolrUpDown::noticeComboSolrAjkAPI($broker['cityId'], $house['brokerId'], $house['proId'], Bll_Combo_NoticeSolrUpDown::SOLR_ACTION_DOWN); if ($apiResponse['status'] == 'ok') { $this->logMsg(sprintf('房源[%d] 通知下架成功', $house['proId'])); } else { $this->logMsg(sprintf('房源[%d] 通知下架失败, apiResponse:%s', $house['proId'], json_encode($apiResponse))); } } } if (count($brokerList) < self::BROKER_LIMIT) { $this->logMsg(sprintf('startId: %d 经纪人已经处理完成', $this->_startId)); file_put_contents($this->_doneFile, 'YES'); } }