本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::getMultiBrokerLevels方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::getMultiBrokerLevels方法的具体用法?PHP Model_Broker_AjkBrokerExtend::getMultiBrokerLevels怎么用?PHP Model_Broker_AjkBrokerExtend::getMultiBrokerLevels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Broker_AjkBrokerExtend
的用法示例。
在下文中一共展示了Model_Broker_AjkBrokerExtend::getMultiBrokerLevels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_request_internal
public function handle_request_internal()
{
$lng = $this->_params['lng'];
$lat = $this->_params['lat'];
$radius = isset($this->_params['radius']) ? $this->_params['radius'] : 3000;
// 搜索半径,默认3000米
$total = isset($this->_params['total']) ? $this->_params['total'] : 500;
// 最大总数,默认500
$days = isset($this->_params['days']) ? $this->_params['days'] : 3;
// 查询天数,默认3天
$cache = APF_Cache_Factory::get_instance()->get_memcache();
$key = $this->generateCacheKey($lat, $lng, $days);
$result = $cache->get($key);
if ($result === false || $this->isDebugMode()) {
// 获取近几日附近签到过的经纪人坐标
$brokerLocations = Bll_Broker_Location::getRoundBrokerLocationsInThePastFewDays($lng, $lat, $radius, $total, $days);
$brokerIds = array_keys($brokerLocations);
// 获取经纪人的等级
$brokerLevels = Model_Broker_AjkBrokerExtend::getMultiBrokerLevels($brokerIds);
// 获取经纪人微聊状态(根据活动是否进行中,决定是否查询)
if (Bll_Broker_CallAnalysis::isTalentEventOngoing()) {
$brokerChatStats = Model_Chat_TalentStat::findMultiByBrokerIds($brokerIds);
}
// 获取经纪人明星中介状态(未判断城市是否开启等,已 BI 每日生成的最终数据为准)
$brokerStarBrokerStats = Model_Broker_StarIntermediaryScore::findMultiByBrokerIds($brokerIds, date('Y-m-d'));
// 拼装返回数据
$result = array();
foreach ($brokerLocations as $brokerLocation) {
$row = array();
$row['id'] = $brokerLocation['id'];
$row['brokerId'] = $brokerLocation['brokerId'];
$row['lat'] = $brokerLocation['lat'];
$row['lng'] = $brokerLocation['lng'];
$row['updateTime'] = $brokerLocation['updateTime'];
// 获取经纪人状态:活跃 or 非活跃(ajk_brokerextend.BrokerLevel = 'K' 为 活跃经纪人)
$row['isActive'] = intval(isset($brokerLevels[$row['brokerId']]) && $brokerLevels[$row['brokerId']] == 'K');
// 微聊达人
$isChatTalent = -1;
// 默认,微聊达人活动未开始或已结束
if (Bll_Broker_CallAnalysis::isTalentEventOngoing()) {
$isChatTalent = 0;
// 活动中,默认不是微聊达人
if (isset($brokerChatStats[$row['brokerId']])) {
$isChatTalent = $brokerChatStats[$row['brokerId']]['isTalent'];
}
}
$row['isChatTalent'] = $isChatTalent;
// 明星中介
$isStarBroker = 0;
if (isset($brokerStarBrokerStats[$row['brokerId']])) {
$isStarBroker = $brokerStarBrokerStats[$row['brokerId']]['isMingxing'];
}
$row['isStarBroker'] = $isStarBroker;
$result[] = $row;
}
$cache->set($key, $result, 0, 900);
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $result);
}