本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::findWithBrokerId方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::findWithBrokerId方法的具体用法?PHP Model_Broker_AjkBrokerExtend::findWithBrokerId怎么用?PHP Model_Broker_AjkBrokerExtend::findWithBrokerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Broker_AjkBrokerExtend
的用法示例。
在下文中一共展示了Model_Broker_AjkBrokerExtend::findWithBrokerId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
$customerId = $this->_params['customerId'];
// 判断经纪人是否存在
$broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$broker) {
throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
}
// 获取客户最新信息
$relation = Model_Mobile_BrokerUserRelation::getBrokerCustomerMonthLatestRelation($brokerId, $customerId);
if (!$relation) {
$relation = Model_Mobile_BrokerUserRelation::getBrokerCustomerLatestTryLockRelation($brokerId, $customerId);
if (!$relation) {
throw new Exception_CustomerRush_RelationNotFound("BrokerId: {$brokerId}; CustomerId: {$customerId};");
}
}
switch ($relation->rentType) {
case 1:
$rentDesc = '整租';
break;
case 2:
$rentDesc = '合租';
break;
default:
$rentDesc = '';
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('preferPrice' => $relation->pricePreference, 'preferHouseType' => $relation->houseTypePreference, 'preferCommunities' => explode(',', $relation->commPreferenceDesc), 'channelType' => $relation->channelType, 'channelDesc' => $relation->channelDesc, 'rentType' => $relation->rentType, 'rentDesc' => $rentDesc));
}
示例2: 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);
}
//经纪人所有二手房房源
$tempHouseInfoList = Bll_House_EsfHouse::getBrokerAllPropInfoList($brokerId, $brokerInfo->cityId);
//过滤违规房源
$commIds = array();
foreach ($tempHouseInfoList as $key => $houseInfo) {
$illegal = isset($houseInfo['isVisible']) ? $houseInfo['isVisible'] : 1;
if ($illegal == 0 && $houseInfo['ExpireWorker'] != 'propertyReport') {
unset($tempHouseInfoList[$key]);
continue;
}
$commIds[] = $houseInfo['commId'];
}
$commInfos = Bll_Community_APIComm::getInstance()->getInfoByIdMapping($commIds);
$commlist = array();
foreach ($commInfos as $commInfo) {
$row = array();
$row['commId'] = $commInfo['commId'];
$row['commName'] = $commInfo['commName'];
$row['commAddress'] = $commInfo['commLocal'];
$commlist[] = $row;
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('commlist' => $commlist));
}
示例3: before
public function before()
{
//防止端口城市对pp城市接口的访问
//接受参数:判断是否是套餐经纪人,是报错,不是,继续执行
$request_body = file_get_contents('php://input');
if ($request_body) {
$res = json_decode($request_body, true);
if (is_array($res)) {
foreach ($res as $k => $v) {
$_REQUEST[$k] = $v;
}
}
}
$params = $_REQUEST;
$brokerId = $params['brokerId'];
if (empty($brokerId)) {
echo json_encode(Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS));
return self::STEP_EXIT;
}
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (empty($brokerInfo)) {
echo json_encode(Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS));
return self::STEP_EXIT;
}
$isComboCity = Bll_Combo_HouseRelation::isComboCity($brokerInfo->cityId);
if ($isComboCity['code'] == 200) {
if ($isComboCity['data']) {
echo json_encode(Util_MobileAPI::error(Const_APIStatus::E_BROKER_ISNOT_PPC));
return self::STEP_EXIT;
}
}
return self::STEP_CONTINUE;
}
示例4: handle_request_internal
public function handle_request_internal()
{
$business = $this->_params['business'];
switch ($business) {
case 'combo':
$payType = 9999;
break;
default:
$payType = 9999;
}
$brokerId = $this->_params['brokerId'];
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
$cityId = $brokerInfo['cityId'];
$comboInfo = Bll_Combo_HouseRelation::isComboCity($cityId);
if ($comboInfo['data']) {
$timeBool = Model_Combo_BusinessUseConfig::getCityComboConfig($cityId);
if (!empty($timeBool) && time() < $timeBool['startTime']) {
//切换套餐 数据处理完成之前 不允许切换经纪人paytype
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('message' => '切换失败,城市尚未开放套餐'));
}
$brokerInfo->payType = $payType;
if ($brokerInfo->save()) {
$result = array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('message' => '切换成功'));
} else {
$result = array('status' => 'error', 'errcode' => __LINE__, 'message' => '切换失败');
}
} else {
$result = array('status' => 'error', 'errcode' => __LINE__, 'message' => '非套餐城市');
}
return $result;
}
示例5: handle_request_internal
public function handle_request_internal()
{
header("Access-Control-Allow-Origin: *");
$brokerId = $this->_params['brokerId'];
$result = array('status' => 'error', 'message' => '');
$broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$broker) {
$result['message'] = '经纪人不存在';
return $result;
}
//获取经纪人已服务客户数
$servicedCusSum = Model_RecommendCus_ServedCustomer::getServedRequireSumByBrokerId($brokerId);
//获取每个用户请求的基本信息
$tmpRequireBaseInfo = Model_RecommendCus_PushedRecommendCus::findRequireInfoWithBrokerId($brokerId);
// 修复BI重复推送数据
$requireBaseInfo = $this->dealRequireBaseInfo($tmpRequireBaseInfo);
if (empty($requireBaseInfo)) {
return array("status" => "ok", "data" => array("brokerId" => $brokerId, "servicedCusSum" => $servicedCusSum, "requireList" => array()));
}
//根据请求id获取每个请求的详细信息
$requireInfo = Bll_RecommendCus::getRequireInfoByRequireId($requireBaseInfo);
if ($requireInfo['message'] == '数据错误') {
$result['message'] = '数据错误';
return $result;
}
$requireList = Bll_RecommendCus::getRequireDetailInfo($requireInfo);
return array("status" => "ok", "data" => array("brokerId" => $brokerId, "servicedCusSum" => $servicedCusSum, "requireList" => $requireList));
}
示例6: before
public function before()
{
$request_body = file_get_contents('php://input');
if ($request_body) {
$res = json_decode($request_body, true);
if (is_array($res)) {
foreach ($res as $k => $v) {
$_REQUEST[$k] = $v;
}
}
}
$params = $_REQUEST;
if (intval(date('Ymd', time())) <= 20141103 && !isset($params['forTest'])) {
return self::STEP_CONTINUE;
}
$brokerId = $params['brokerId'];
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
$curCityId = $brokerInfo->cityId;
$noValueAddedServiceCitys = APF::get_instance()->get_config("no_value_added_service_city", 'multicity');
foreach ($noValueAddedServiceCitys as $cityId) {
if ($cityId == $curCityId) {
$data = array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_BROKER_NO_VALUE_ADDED_SERVICE, 'message' => '当前城市暂不开通此业务。');
header('Content-Type: application/json; charset=utf-8');
echo json_encode($data);
return self::STEP_EXIT;
}
}
return self::STEP_CONTINUE;
}
示例7: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$brokerInfo) {
throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
}
//名片格式
$bnsCardFileJson = json_decode($this->_params['bnsCardFile'], true);
$size = $bnsCardFileJson['size'];
$width = $bnsCardFileJson['width'];
$height = $bnsCardFileJson['height'];
$format = $bnsCardFileJson['format'];
//判断图片大小,格式是否正确
if ($size > 614400 || $size < 20480) {
throw new Exception_Broker_UpLoadFailed('pic_error,文件应大于20KB,小于600KB');
} elseif ($width < 300 || $height < 200) {
throw new Exception_Broker_UpLoadFailed('pic_error,图片应大于300*200像素');
} elseif (!in_array($format, array('JPEG', 'JPG', 'GIF', 'PNG'))) {
throw new Exception_Broker_UpLoadFailed('pic_error,图片限jpg、jpeg、gif、png格式');
}
//上传名片接口
$bnsCardFile = 'display/' . $bnsCardFileJson['hash'] . '_' . $bnsCardFileJson['host'];
//$bnsCardFile = 'c9ed1c5f41cd95df97391e5e60ab3c96_1';
$setBizCard = Bll_BrokerBaseBll::setBizCard($brokerId, $brokerInfo->cityId, $brokerInfo->areaCode, $brokerInfo->userMobile, '', $bnsCardFile, $brokerInfo->companyId, $brokerInfo->cstBrokerCompanyId);
if ($setBizCard == 1) {
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => 1));
} else {
throw new Exception_Broker_UpLoadApiFailed($setBizCard['message']);
}
}
示例8: handle_request_internal
public function handle_request_internal()
{
header("Access-Control-Allow-Origin: *");
$brokerId = $this->_params['brokerId'];
$result = array('status' => 'error', 'message' => '');
$broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$broker) {
$result['message'] = '经纪人不存在';
return $result;
}
//获取已服务的客户列表
$servedCustomerList = Model_RecommendCus_ServedCustomer::getServedRequireByBrokerId($brokerId);
$servedrequireIds = array();
foreach ($servedCustomerList as $key => $value) {
$servedrequireIds[] = $value['requirePropId'];
}
//获取每个用户请求的基本信息
$requireBaseInfo = Model_RecommendCus_PushedRecommendCus::findRequireInfoWithRequireId($brokerId, $servedrequireIds);
if (empty($requireBaseInfo)) {
return array("status" => "ok", "data" => array("brokerId" => $brokerId, "requireList" => array()));
}
//根据请求id获取每个请求的详细信息
$requireInfo = Bll_RecommendCus::getRequireInfoByRequireId($requireBaseInfo);
if ($requireInfo['message'] == '数据错误') {
$result['message'] = '数据错误';
return $result;
}
$requireList = Bll_RecommendCus::getRequireDetailInfo($requireInfo);
return array("status" => "ok", "data" => array("brokerId" => $brokerId, "requireList" => $requireList));
}
示例9: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
// 判断经纪人是否存在
$broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$broker) {
throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
}
$this->cityId = $broker->cityId;
$data = $this->_params['data'];
$data = json_decode($data, TRUE);
// file_put_contents('/data1/logs/addRang.txt',json_encode($data)."\n",FILE_APPEND);
if (!is_array($data)) {
return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'message' => '数据信息错误');
}
//添加区域板块
$saleBlockData = $data['saleBlock'];
if (!$this->doBlock($brokerId, $saleBlockData)) {
return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'message' => '区域板块保存失败');
}
//添加主营小区
$saleCommunityData = $data['saleCommunity'];
if (!$this->doSaleCommunity($brokerId, $saleCommunityData)) {
return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'message' => '主营小区保存失败');
}
//添加代理新盘
$newCommunityData = $data['newCommunity'];
if (!$this->doNewCommunity($brokerId, $newCommunityData)) {
return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'message' => '代理新盘保存失败');
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('message' => '保存成功'));
}
示例10: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
//检查经纪人是否存在
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$brokerInfo) {
throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
}
// 判断城市是否开通竞价业务
$cityId = $brokerInfo->cityId;
if (!Bll_City::isBidCity($cityId)) {
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'totalProps' => 0));
}
$data = array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元');
$datei = date('Ymd');
//获取经纪人竞价推广某天的点击和花费信息
$allClickAndCostInfo = Model_Plan_HpProStatsDay::getBrokerClickAndCostDay($brokerId, $cityId, $datei);
foreach ($allClickAndCostInfo as $row) {
$data['todayClicks'] += $row->cnum;
$data['todayConsume'] += $row->amount / 100;
}
$data['todayConsume'] = Util_Formatter::formatTodayConsume($data['todayConsume']);
//获取计划数
$data['totalProps'] = Model_Plan_EsfAjkPropSpread::getPlanCountByBroker($brokerId, Model_Plan_EsfAjkPropSpread::DEFAULTVERSION);
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
}
示例11: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$brokerInfo) {
throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
}
$usrCardState = $brokerInfo->usrCardState;
$usrPhotoState = $brokerInfo->usrPhotoState;
$photoFileJson = json_decode($this->_params['photoFile'], true);
$size = $photoFileJson['size'];
$format = $photoFileJson['format'];
if ($size > 1048576) {
throw new Exception_Broker_UpLoadFailed('头像图片不得大于1M');
} elseif (!in_array($format, array('JPEG', 'JPG', 'GIF', 'PNG'))) {
throw new Exception_Broker_UpLoadFailed('图片限jpg、jpeg、gif、png格式');
}
$photoFile = 'display/' . $photoFileJson['hash'] . '_' . $photoFileJson['host'];
//调用上传头像的接口
$setNewPhoto = Bll_BrokerBaseBll::setNewPhoto($brokerId, $photoFile);
if ($setNewPhoto == 1) {
if ($usrCardState == 1 || $usrCardState == 2) {
Bll_Broker_BrokerCheckInfo::autoSendPass($brokerId);
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => 1));
} else {
throw new Exception_Broker_UpLoadApiFailed($setNewPhoto['message']);
}
}
示例12: handle_request_internal
public function handle_request_internal()
{
// 修改微信号,并点亮微信号展示, 生成微信二维码--> 数据库保存
$brokerId = $this->_params['brokerId'];
$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$brokerInfo) {
throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
}
//修改微信号 点亮
$wechatName = $this->_params['wechatName'];
$ret = $this->upLoadQrImage($wechatName);
if (!$ret) {
throw new Exception_Chat_UpLoadQrImageFailed();
}
// 获取经纪人店铺
$shop = Model_Weshop_Shop::getBrokerShop($brokerId);
$shop->wechatName = $wechatName;
$shop->isLighten = 1;
$shop->qrHostId = $ret['image']['host'];
$shop->qrHash = $ret['image']['hash'];
$res = $shop->save();
if ($res) {
Bll_Mobile_ChatInfoBll::ModifyBrokerWechatNameNotice($brokerId);
//通知用户端
}
//生成二维码
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('message' => '恭喜你,已点亮微信号展示'));
}
示例13: getUserAccountId
/**
* 获取支付中心账户id
* @param $brokerId
* @param $userId
* @param $isCreate
* @return accountId
*/
public function getUserAccountId($brokerId, $userId = "", $isCreate = true)
{
if (empty($brokerId)) {
return 0;
}
$tmp = Model_Mobile_CustomerBrokerAccount::getInstance()->getDataByBrokerId($brokerId);
if (!empty($tmp)) {
return $tmp['accountId'];
} elseif ($isCreate) {
if (empty($userId)) {
$broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
$userId = !empty($broker) ? $broker['userId'] : 0;
}
if (!$userId) {
return 0;
}
// 创建账户
$tmp = $this->createAccount($userId);
if ($tmp['status'] === true) {
// 插入数据库表
$insertData = array('brokerId' => $brokerId, 'accountId' => $tmp['accountId'], 'createTime' => time());
$this->insertUserAccount($insertData);
return $tmp['accountId'];
} else {
return 0;
}
} else {
return 0;
}
}
示例14: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
// 判断经纪人是否存在
$broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
$hzBrokerId = Model_Broker_MainBusiness::getHzBrokerIdByAjkBrokerId($brokerId);
if (!$hzBrokerId || !$broker) {
throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
}
// 判断城市是否开通竞价业务
$cityId = $broker['cityId'];
if (!Bll_City::isBidCity($cityId)) {
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'totalProps' => 0));
}
// 获取今日房源点击和消费记录
$clicksInfo = Model_Stats_PropClick::getClickInfoByBrokerId($hzBrokerId, $cityId);
// 统计今日竞价点击和消费
$todayClicks = 0;
$todayConsume = 0;
foreach ($clicksInfo as $objClick) {
$todayClicks += $objClick->bid_cnum;
$todayConsume += $objClick->bid_cost;
}
// 获取竞价房源数
$bidPropNum = Bll_HzBidPlan::get_broker_bidprop_count($hzBrokerId);
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => $todayClicks, 'todayConsume' => Util_Formatter::formatTodayConsume($todayConsume / 100), 'todayConsumeUnit' => '元', 'totalProps' => $bidPropNum));
}
示例15: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
$customerId = $this->_params['customerId'];
$pushDate = $this->_params['pushDate'];
// 判断经纪人是否存在
$broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (!$broker) {
throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
}
// 判断经纪人和客户之间关系是否存在(给定日期)
$relation = Model_Mobile_BrokerUserRelation::getBrokerCustomerRelationWithDate($brokerId, $customerId, $pushDate);
if (!$relation) {
throw new Exception_CustomerRush_RelationNotFound("BrokerId: {$brokerId}; CustomerId: {$customerId}; Date: {$pushDate}");
}
// 判断经纪人和客户是否已经有效锁定(未过期临时锁定 或 永久锁定)
$status = intval($relation->isLocked());
if ($status) {
if ($relation->isTempLocked()) {
$statusMsg = '临时锁定';
} else {
$statusMsg = '永久锁定';
}
} else {
$statusMsg = '客户失效了 重新抢吧';
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => $status, 'statusMsg' => $statusMsg));
}