本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::findMultiBrokers方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::findMultiBrokers方法的具体用法?PHP Model_Broker_AjkBrokerExtend::findMultiBrokers怎么用?PHP Model_Broker_AjkBrokerExtend::findMultiBrokers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Broker_AjkBrokerExtend
的用法示例。
在下文中一共展示了Model_Broker_AjkBrokerExtend::findMultiBrokers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_request_internal
public function handle_request_internal()
{
header("Access-Control-Allow-Origin: *");
$lng = $this->_params['lng'];
$lat = $this->_params['lat'];
$brokerId = $this->_params['brokerId'];
$radius = isset($this->_params['radius']) ? $this->_params['radius'] : 3000;
// 搜索半径,默认3000米
$total = isset($this->_params['total']) ? $this->_params['total'] : 100;
// 最大总数,默认500
$days = isset($this->_params['days']) ? $this->_params['days'] : 3;
// 查询天数,默认3天
//获取附近经纪人Id
$brokerLocations = Bll_Broker_Location::getRoundBrokerLocationsInThePastFewDays($lng, $lat, $radius, $total, $days);
$brokerIds = array_keys($brokerLocations);
//根据经纪人Id数组查询多个经纪人信息
$brokerInfosTmp = Model_Broker_AjkBrokerExtend::findMultiBrokers($brokerIds);
//提取经纪人ID
$brokerIds = $brokerInfos = array();
foreach ($brokerInfosTmp 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) {
$re = array();
$distance = Util_Map::distance($lng, $lat, $brokerLocations[$chatInfo['brokerId']]['lng'], $brokerLocations[$chatInfo['brokerId']]['lat']);
$distance = round($distance / 1000, 2);
if ($distance > 3 || $brokerInfos[$chatInfo['brokerId']]->checkState != 1) {
continue;
}
$re['brokerId'] = $chatInfo['brokerId'];
$re['companyInfo'] = $brokerInfos[$chatInfo['brokerId']]->company;
$re['trueName'] = $brokerInfos[$chatInfo['brokerId']]->trueName;
$re['userMobile'] = $brokerInfos[$chatInfo['brokerId']]->userMobile;
$disarr[] = $distance;
$re['distance'] = $distance;
$re['userPhoto'] = Util_ImageUtils::get_broker_photo_url($brokerInfos[$chatInfo['brokerId']]->userPhoto, '200x200');
$re['chatId'] = $chatInfo['chatId'];
$re['twoCodeIcon'] = $chatInfo['twoCodeIcon'];
$brokers[] = $re;
}
//按距离排序
array_multisort($disarr, $brokers);
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('brokerList' => $brokers));
}
示例2: handle_request_internal
public function handle_request_internal()
{
$brokerIds = explode(',', $this->_params['brokerIds']);
$brokerInfos = Model_Broker_AjkBrokerExtend::findMultiBrokers($brokerIds);
$brokerBaseInfo = array();
foreach ($brokerInfos as $brokerInfo) {
$row = array();
$row['brokerId'] = $brokerInfo['brokerId'];
$row['userMobile'] = $brokerInfo['userMobile'];
$row['trueName'] = $brokerInfo['trueName'];
$row['cityId'] = $brokerInfo['cityId'];
$row['userPhotoUrl'] = Util_DisplayImages::get_img_url($brokerInfo['userPhoto'], -1, '100x133');
$row['userDescription'] = '';
$brokerBaseInfo[] = $row;
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $brokerBaseInfo);
}
示例3: getBrokers
/**
* @return array|bool
*/
protected function getBrokers()
{
switch ($this->action) {
case 'hotfix':
// 获取指定的经纪人
$brokers = Model_Broker_AjkBrokerExtend::findMultiBrokers($this->brokerIds);
break;
case 'default':
// 获取最近更新过的经纪人记录
// 获取最近更新过的经纪人记录
default:
$brokers = array();
$items = Model_Log_LogMergeQueneNew::getMultiBrokersByIdCursor($this->cursor['id'], $this->per);
foreach ($items as $item) {
$id = $item['id'];
$brokers[$id] = $item->getContext();
$brokers[$id]['brokerId'] = $item['brokerId'];
$brokers[$id]['id'] = $id;
}
}
return $brokers;
}
示例4: formatdate
//.........这里部分代码省略.........
} else {
$row['ownerChatId'] = '';
}
$row['commId'] = $data['commId'];
//对应的小区ID
$row['commName'] = $data['commName'];
//小区名称
$row['commLocal'] = $commLocal;
//小区地址
$row['roomNum'] = $data['roomNum'];
//房间数量
$row['hallNum'] = $data['hallNum'];
//客厅的数量x
$row['toiletNum'] = $data['toiletNum'];
//卫生间的数量
$row['areaNum'] = $data['areaNum'];
//房源的建筑面积;单位”平米”
$row['areaUnit'] = '平米';
//房源的建筑面积;单位”平米”
$row['propPrice'] = $data['proPrice'];
//房源价格(万元)/房源租金(元/月)
$row['priceUnit'] = $data['commissionType'] == 1 ? '万元' : '元/月';
//房源价格(万元)/房源租金(元/月)
$row['entrustType'] = $data['commissionType'];
//1-出售,2-出租
if (!empty($imgInfos) && $data['commissionType'] == 1) {
foreach ($imgInfos as $imginfo) {
$img = array();
$img['id'] = $imginfo['id'];
$img['smallImageUrl'] = Util_Image::getInstance()->getResizeURL($imginfo['imageId'], $imginfo['hostId'], 100, 75);
//(拼好小图)
$img['bigImageUrl'] = Util_Image::getInstance()->getResizeURL($imginfo['imageId'], $imginfo['hostId'], 600, 600);
//(拼好大图)
$img['hostId'] = $imginfo['hostId'];
$img['width'] = $imginfo['width'] ? $imginfo['width'] : 1280;
$img['height'] = $imginfo['height'] ? $imginfo['height'] : 1500;
$img['hash'] = $imginfo['imageId'];
$img['type'] = 2;
//图片类型 1:小区图 2: 室内图 3: 户型图
$img['entry'] = 4;
//图片来源 1:系统默认 2:相机拍摄 3:相册选取 4: 在线图库
$img['exists'] = 1;
//图片是否已存在
$img['format'] = 'JPEG';
$imgs[] = $img;
}
$row['imagesInfo'] = $imgs;
} else {
$row['imagesInfo'] = array();
}
if ($showStatus == 5 || $showStatus == 6) {
$row['showStatus'] = 7;
} else {
$row['showStatus'] = $showStatus;
}
//房源状态 0-非法数据暂时没用 1-违规删除 2-已过期 3-抢完了 4-可以抢 5-抢到未发布;6-抢到已发布未推广;7-抢到已发布已推广;8-房东已删除;9-房东停止委托;
$row['propertyId'] = $propertyId;
$row['created'] = $data['created'];
//创建时间
$row['lastModifyDate'] = $data['lastModifyDate'];
//最后更改时间
$row['brokerIds'] = $eBrokers ? implode(',', $eBrokers) : '';
//该套委托二手房源的所有经纪人id
$row['isRealityPats'] = empty($imgs) ? 0 : 1;
//实拍icon 1:显示实拍 0:不显示
if (!empty($business)) {
$row['isChoiceCity'] = in_array($data['cityId'], $business) ? 1 : 0;
//1:精选城市 0:非精选城市
} else {
$row['isChoiceCity'] = 0;
}
$row['timeState'] = Bll_Common_Format::formatTime($data['created']);
//倒计时
$row['brokerImages'] = array();
if ($showStatus == 3) {
//已抢完,加入经纪人头像
$commissionInfo = Model_House_Commission::getCommissionsOrderById(intval($data['id']));
$brokerIds = array();
foreach ($commissionInfo as $comm) {
$brokerIds[] = $comm['brokerId'];
}
$brokerInfo = array();
$brokers = array();
$brokerInfo = Model_Broker_AjkBrokerExtend::findMultiBrokers($brokerIds);
foreach ($brokerInfo as $broInfo) {
$brokers[$broInfo['brokerId']] = $broInfo;
}
if (!empty($brokerIds)) {
foreach ($brokerIds as $broId) {
$photo = Util_ImageUtils::get_broker_photo_url($brokers[$broId]['userPhoto'], '200x200');
$row['brokerImages'][] = $photo ? $photo : APF::get_instance()->get_config("broker_image_url");
}
} else {
for ($i = 0; $i < 5; $i++) {
$row['brokerImages'][$i] = APF::get_instance()->get_config("broker_image_url");
}
}
}
return $row;
}