本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::getDataByAreaCodeAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::getDataByAreaCodeAll方法的具体用法?PHP Model_Broker_AjkBrokerExtend::getDataByAreaCodeAll怎么用?PHP Model_Broker_AjkBrokerExtend::getDataByAreaCodeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Broker_AjkBrokerExtend
的用法示例。
在下文中一共展示了Model_Broker_AjkBrokerExtend::getDataByAreaCodeAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_request_internal
public function handle_request_internal()
{
header("Access-Control-Allow-Origin: *");
$brokerId = $this->_params['brokerId'];
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$brokerInfo) {
throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
}
//根据区域代码查询经纪人
$brokerArea = $brokerInfo->areaCode;
$brokerInfoTmp = Model_Broker_AjkBrokerExtend::getDataByAreaCodeAll($brokerArea);
//提取经纪人ID
$brokerIds = $brokerInfos = array();
foreach ($brokerInfoTmp as $value) {
if ($value->brokerId != $brokerId) {
$brokerIds[] = $value->brokerId;
$brokerInfos[$value->brokerId] = $value;
}
}
//批量查询微聊信息
$chatInfos = Bll_Mobile_ChatInfoBll::getInstance()->GetChatInfoByIds($brokerIds);
//根据微聊信息筛选经纪人,去除微聊信息为空的经纪人
$brokers = array();
foreach ($chatInfos as $chatInfo) {
if ($brokerInfos[$chatInfo['brokerId']]->checkState != 1) {
continue;
}
$re = array();
$re['brokerId'] = $chatInfo['brokerId'];
$re['trueName'] = $brokerInfos[$chatInfo['brokerId']]->trueName;
$re['userMobile'] = $brokerInfos[$chatInfo['brokerId']]->userMobile;
$re['companyInfo'] = $brokerInfos[$chatInfo['brokerId']]->company;
$re['userPhoto'] = Util_ImageUtils::get_broker_photo_url($brokerInfos[$chatInfo['brokerId']]->userPhoto, '200x200');
$re['chatId'] = $chatInfo['chatId'];
$re['twoCodeIcon'] = $chatInfo['twoCodeIcon'];
$brokers[] = $re;
}
foreach ($brokers as $broker) {
$brokerCompany[] = $broker['company'];
}
//按公司排序
array_multisort($brokerCompany, $brokers);
$keyReturn = array();
foreach ($brokers as $broker) {
$keyReturn[$broker['companyInfo']]['company'] = $broker['companyInfo'];
$keyReturn[$broker['companyInfo']]['broker'][] = $broker;
}
$brokerList = array_values($keyReturn);
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('brokerList' => $brokerList));
}