本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::getDataByBrokerId方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::getDataByBrokerId方法的具体用法?PHP Model_Broker_AjkBrokerExtend::getDataByBrokerId怎么用?PHP Model_Broker_AjkBrokerExtend::getDataByBrokerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Broker_AjkBrokerExtend
的用法示例。
在下文中一共展示了Model_Broker_AjkBrokerExtend::getDataByBrokerId方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dealTask
/**
* @param $task
* @return bool
*/
public function dealTask($task)
{
$brokerId = $task['brokerId'];
$amount = $task['amount'];
$siteType = Const_ShowcaseOrders::SALE_DB;
if ($task['siteType'] == 2) {
$siteType = Const_ShowcaseOrders::RENT_DB;
}
$requestId = Bll_Broker_ShowcaseAdConsumeQueue::getPaymentRequestId($task['id'], $this->currentYMD, $siteType);
//获取账户余额
$ajkBrokerData = Model_Broker_AjkBrokerExtend::getDataByBrokerId($brokerId);
$userId = !empty($ajkBrokerData) ? $ajkBrokerData->userId : 0;
$cityId = $ajkBrokerData->cityId;
$balance = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerMoney($userId);
$balance = $balance * 100;
if ($balance < $amount) {
//余额不足,停止橱窗订单,更新订单操作日志.
$this->stopShowCase($task, $siteType, $cityId);
//TODO 更新扣费队列状态
$updateArr = array('status' => 1, 'requestId' => $requestId, 'remark' => json_encode(array('balance' => $balance, 'remark' => '余额不足')));
} else {
//余额足够,调用扣费API
$apiResult = Bll_Broker_ShowcaseConsumeQuery::getInstance()->callCosumeApi($userId, $requestId, $amount, $task['consumeDate'], $siteType);
//扣费成功
if ($apiResult['status'] === true) {
$updateArr = array('status' => 3, 'requestId' => $requestId, 'remark' => json_encode(array('balance' => $balance, 'apiData' => $apiResult['apiData'])));
} else {
$updateArr = array('status' => 2, 'requestId' => $requestId, 'remark' => json_encode(array('balance' => $balance, 'apiData' => $apiResult['apiData'])));
}
}
//更新扣费队列状态
Bll_Broker_ShowcaseAdConsumeQueue::updateConsumeInfo($updateArr, array('id' => $task['id']));
return true;
}
示例2: getComboListByJavaApi
/**
* 通过java接口获取套餐列表
*
* @param $brokerId
* @return bool|mixed
*/
public function getComboListByJavaApi($brokerId)
{
$ajkBrokerData = Model_Broker_AjkBrokerExtend::getDataByBrokerId($brokerId);
$host = APF::get_instance()->get_config("JavaAPIHost");
$url = $host . "service-combo/rest/combo/order/myOrder/?json&userId={$ajkBrokerData->userId}";
$res = Util_Curl::service_curl($url);
return $res;
}
示例3: getUserIdByBrokerId
/**
* 获取userId
* @param $brokerId 二手房经纪人id
* @param $type
* @return int
*/
public static function getUserIdByBrokerId($brokerId, $type)
{
/*if($type == Const_ShowcaseOrders::SALE_DB){ // 二手房
$ajkBrokerData = Model_Broker_AjkBrokerExtend::getDataByBrokerId($brokerId);
}elseif($type == Const_ShowcaseOrders::RENT_DB){
$ajkBrokerId = self::getAjkBrokerByhzBrokerId($brokerId); // 租房
$ajkBrokerData = Model_Broker_AjkBrokerExtend::getDataByBrokerId($ajkBrokerId);
}else{
return 0;
}*/
$ajkBrokerData = Model_Broker_AjkBrokerExtend::getDataByBrokerId($brokerId);
return !empty($ajkBrokerData) ? $ajkBrokerData->userId : 0;
}
示例4: handle_request
public function handle_request()
{
$currentTableSplitSuffix = date('m');
$failedActionQueue = Model_Choice_ActionQueue::getFailedAbandonFee($this->queueId, Model_Choice_ActionQueue::ENUM_HAOZU, $this->tableSplitSuffix);
if (empty($failedActionQueue)) {
/** 如果不是同一个月的话,那么前一个月没有需要修复的数据就开始修复本月的数据 */
if (strcmp($currentTableSplitSuffix, $this->tableSplitSuffix) != 0) {
$this->saveCursor($currentTableSplitSuffix, 0);
}
return;
}
$this->log("开始修复: ID={$failedActionQueue['id']}\tBrokerId={$failedActionQueue['brokerId']}\tPlanId={$failedActionQueue['planId']}\tupdateRemark={$failedActionQueue['updateRemark']}");
$ajkBrokerExtend = Model_Broker_AjkBrokerExtend::getDataByBrokerId($failedActionQueue['brokerId']);
/** TODO 添加获取二手房经纪人信息为空日志 */
if (empty($ajkBrokerExtend)) {
$this->log(sprintf(' 获取经纪人(%d)的UserId失败(%d)。', $failedActionQueue['brokerId'], $failedActionQueue['id']));
$this->saveCursor($this->tableSplitSuffix, $failedActionQueue['id']);
return;
}
$planExtend = Dao_Broker_HzPlan::get_bid_sn($failedActionQueue['planId']);
/** TODO 添加获取SN 失败日志 */
if (empty($planExtend)) {
$this->log(sprintf(' 获取计划(%d)的SN失败(%d)。', $failedActionQueue['planId'], $failedActionQueue['id']));
$this->saveCursor($this->tableSplitSuffix, $failedActionQueue['id']);
return;
}
// $planInfo = Dao_Broker_HzPlan::get_plan($failedActionQueue['planId']);
$planInfo = Model_Plan_HzPlanBasic::get_plan_by_id($failedActionQueue['planId']);
/** TODO 添加获取计划信息失败日志*/
if (empty($planInfo)) {
$this->log(sprintf(' 获取计划(%d)的信息失败(%d)。', $failedActionQueue['planId'], $failedActionQueue['id']));
$this->saveCursor($this->tableSplitSuffix, $failedActionQueue['id']);
return;
}
//精选结算
$amount = $planInfo['total_consume'];
$note = '%E8%A7%A3%E5%86%BB';
$this->log(" 传递的参数:UserId={$ajkBrokerExtend['userId']}\tamount={$amount}\tplanId={$failedActionQueue['planId']}\tSN={$planExtend['sn']}");
$unlockSuccess = Bll_PayAccount::cancel_frozen($ajkBrokerExtend['userId'], $amount, $failedActionQueue['planId'], Const_PaymentApp::HZ_CHOICE, $planExtend['sn'], $note, true);
if ($unlockSuccess === true) {
$this->log(' 解冻成功。');
$this->saveCursor($this->tableSplitSuffix, $failedActionQueue['id']);
$repairRemark = $failedActionQueue['updateRemark'] . ', 解冻修复成功';
/** 更新队列状态为处理成功 */
Model_Choice_ActionQueue::setBidQueenStatusById($this->tableSplitSuffix, $failedActionQueue['id'], Model_Choice_ActionQueue::ENUM_SUCCESS, $repairRemark);
return;
}
$this->log(' 解冻失败。');
}
示例5: beforeHandlerRequest
public function beforeHandlerRequest()
{
if (!$this->params['brokerId']) {
$this->outPut(0, '参数缺失');
}
// 获取经纪人信息
$brokerInfo = Model_Broker_AjkBrokerExtend::getDataByBrokerId($this->params['brokerId']);
$this->params['cityId'] = $brokerInfo->cityId;
$this->params['userId'] = $brokerInfo->userId;
/** 不是套餐城市就直接返回 */
if (!Bll_City::isComboCity($this->params['cityId'])) {
$this->outPut(0, '未开通套餐业务');
}
/** 不是套餐经纪人直接返回 */
if (!Bll_Broker_HzBroker::isComboBroker($this->params['brokerId'])) {
$this->outPut(0, '不是套餐经纪人');
}
}
示例6: handle_request_internal
public function handle_request_internal()
{
$brokerId = $this->_params['brokerId'];
$plans = Model_Plan_EsfFixedPlan::getValidPlan($brokerId);
$props = 0;
$result['status'] = 'ok';
if (!empty($plans)) {
$planId = $plans['id'];
$cityId = $plans['cityid'] ?: 0;
$relations = Model_Plan_AjkFixRelation::getRelationListByPlanId($planId, $cityId);
if (!empty($relations)) {
$propIds = array();
foreach ($relations as $row) {
$propIds[] = $row['proId'];
}
$houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId);
$props = count($houseInfo);
}
$planBll = new DAO_My_Ppc_PlanOpe();
$clicks = $planBll->planTodayNewCost($planId);
$data['planId'] = $planId;
$data['todayClicks'] = $clicks['allclick'];
$data['todayConsume'] = Util_Formatter::formatTodayConsume($clicks['allamount']);
$data['todayConsumeUnit'] = '元';
$data['totalProps'] = $props;
//获取计划状态
$api_url = '/service-ppc/rest/ppc/getPpcPlan/' . $planId . '?resType=1';
$plan_info = Util_CallAPI::get_data_from_java_api($api_url);
$data['planStatus'] = $plan_info['data']['plan']['statusDescrip'] == '推广中' ? 1 : 0;
$limitInfo = Bll_Fixedspread_AjkFixedSpread::getLimitInfo($brokerId);
$data['budget'] = !empty($limitInfo) ? round($limitInfo['amountLimit'] / 100, 2) : 0;
$data['budgetUnit'] = '元';
} else {
$brokerInfo = Model_Broker_AjkBrokerExtend::getDataByBrokerId($brokerId);
$planId = Model_Plan_EsfFixedPlan::addPlan('定价推广组', 1, $brokerInfo->cityId, $brokerInfo->userId, $brokerInfo->brokerId);
$data['planId'] = $planId;
$data['todayClicks'] = $data['todayConsume'] = $data['totalProps'] = $data['planStatus'] = 0;
$data['todayConsumeUnit'] = $data['budgetUnit'] = '元';
$limitInfo = Bll_Fixedspread_AjkFixedSpread::getLimitInfo($brokerId);
$data['budget'] = !empty($limitInfo) ? round($limitInfo['amountLimit'] / 100, 2) : 0;
}
$result['data'] = $data;
return $result;
}
示例7: handle_request
public function handle_request()
{
$sqlSelectErrorQueue = 'SELECT * from q_new_bid_deal_06 WHERE `actionId`=2 AND `siteType`=2 AND `status`=2 AND `id` >7330;';
$errorQueueList = Model_Choice_ActionQueue::data_access(date('m'))->native_sql($sqlSelectErrorQueue, array());
foreach ($errorQueueList as $errorQueue) {
$this->log("开始修复: ID={$errorQueue['id']}\tBrokerId={$errorQueue['brokerId']}\tPlanId={$errorQueue['planId']}");
$ajkBrokerExtend = Model_Broker_AjkBrokerExtend::getDataByBrokerId($errorQueue['brokerId']);
/** TODO 添加获取二手房经纪人信息为空日志 */
if (empty($ajkBrokerExtend)) {
$this->log(sprintf('获取经纪人(%d)的UserId失败(%d)。', $errorQueue['brokerId'], $errorQueue['id']));
continue;
}
$planExtend = Dao_Broker_HzPlan::get_bid_sn($errorQueue['planId']);
/** TODO 添加获取SN 失败日志 */
if (empty($planExtend)) {
$this->log(sprintf('获取计划(%d)的SN失败(%d)。', $errorQueue['planId'], $errorQueue['id']));
continue;
}
$planInfo = Dao_Broker_HzPlan::get_plan($errorQueue['planId']);
/** TODO 添加获取计划信息失败日志*/
if (empty($planInfo)) {
$this->log(sprintf('获取计划(%d)的信息失败(%d)。', $errorQueue['planId'], $errorQueue['id']));
continue;
}
//精选结算
$amount = $planInfo['total_consume'];
$note = urlencode(sprintf('精选推广(%d)扣费失败修复', $errorQueue['planId']));
$this->log("传递的参数:UserId={$ajkBrokerExtend['userId']}\tamount={$amount}\tplanId={$errorQueue['planId']}\tSN={$planExtend['sn']}");
$charge_sn = Bll_PayAccount::cancel_frozen($ajkBrokerExtend['userId'], $amount, $errorQueue['planId'], Const_PaymentApp::HZ_CHOICE, $planExtend['sn'], $note, true);
if ($charge_sn['data']['status'] === 'ok') {
$this->log('修复成功。');
} else {
$this->log('修复失败。');
}
$this->log(print_r($charge_sn, true));
}
return 'success';
}
示例8: handle_request
public function handle_request()
{
$list = Bll_Broker_ShowcaseArrearageQuery::getInstance()->getBrokerSumList($this->_lastAdSetId, $this->_dateBase);
//$list = Bll_Broker_ShowcaseArrearageQuery::getInstance()->getBrokerSumList(0,$this->_dateBase);
if ($list) {
foreach ($list as $val) {
$this->setMyFlag($val['broker_id']);
$data = array('brokerId' => $val['broker_id']);
$orderinfo = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerOrders($data, $this->_dateBase);
if ($orderinfo) {
$lavedays = ceil((strtotime($orderinfo->endDate) - strtotime(date('Ymd'))) / 3600 / 24);
$brokerInfo = new Model_Broker_AjkBrokerExtend();
$info = $brokerInfo->getDataByBrokerId($val['broker_id']);
$tmp = array('cityId' => $info['cityId'], 'status' => 1, 'startDate' => date('Ymd'));
$cityPrice = Bll_Broker_ConfigCityPrice::getInstance()->getCityPrice($tmp, $this->_dateBase);
$isComboCity = $this->isComboCity($orderinfo->cityId);
if ($isComboCity['code'] == 200) {
if ($isComboCity['data']) {
if ($val['cnt'] >= 1) {
if ($orderinfo->isStop == 0 && $lavedays > 0) {
$stopstatus = Bll_Broker_ShowcaseOrders::getInstance()->stopBrokerOthersAuto($orderinfo, $cityPrice->discountPrice, $this->_dateBase);
if (!$stopstatus['status']) {
$this->getError($this->_dateBaseName, $val['broker_id']);
}
}
}
} else {
if ($val['cnt'] >= 7) {
if ($orderinfo->isStop == 0 && $lavedays > 0) {
$stopstatus = Bll_Broker_ShowcaseOrders::getInstance()->stopBrokerOthersAuto($orderinfo, $cityPrice->discountPrice, $this->_dateBase);
if (!$stopstatus['status']) {
$this->getError($this->_dateBaseName, $val['broker_id']);
}
}
}
}
}
}
/*
if($val['cnt']>=7){
$data = array('brokerId'=>$val['broker_id']);
$orderinfo = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerOrders($data,$this->_dateBase);
if($orderinfo){
$lavedays = ceil((strtotime($orderinfo->endDate)-strtotime(date('Ymd')))/3600/24);
if($orderinfo->isStop==0 && $lavedays > 0 ){
$brokerInfo =new Model_Broker_AjkBrokerExtend();
$info = $brokerInfo->getDataByBrokerId($val['broker_id']);
$tmp = array('cityId'=>$info['cityId'],'status'=>1,'startDate'=>date('Ymd'));
$cityPrice = Bll_Broker_ConfigCityPrice::getInstance()->getCityPrice($tmp,$this->_dateBase);
$stopstatus = Bll_Broker_ShowcaseOrders::getInstance()->stopBrokerOthers($orderinfo,$cityPrice->discountPrice,$this->_dateBase);
if(!$stopstatus['status']){
$mailSubject = date('Ymd').$this->_dateBaseName.'停止订单出错问题';
$mailBody =$this->_dateBaseName.'的二手房经纪人id:'.$val['broker_id'];
Bll_Broker_ShowcaseCommon::getInstance()->sendMail($mailSubject,$mailBody,$this->mailArr);
}
}
}
}
*/
}
} else {
$this->setMyFlag($this->getLastJobId(), 'over');
$mailSubject = $this->yDate . $this->subject;
$mailBody = $mailSubject . "完成 完成时间:" . date("Y-m-d H:i:s", time());
Bll_Broker_ShowcaseCommon::getInstance()->sendMail($mailSubject, $mailBody, $this->mailArr);
$this->setShStopFlag();
exit;
}
}
示例9: handle_request
public function handle_request()
{
$houses = $this->getHouses();
if (!empty($_SERVER['PG_TEST'])) {
//如果是PG
$commIds = APF::get_instance()->get_config('pg_test_communitys_id', 'apiTestId');
} else {
$commIds = APF::get_instance()->get_config('test_communitys_id', 'apiTestId');
}
foreach ($houses as $house) {
//是否收费
$pushOpen = Bll_Broker_EntrustPrice::getInstance()->checkCityConsumeStatus($house['cityId']);
//城市是否开通房源库
//$cityInfo = Bll_Fyk_Prop_Manage::getInstance()->getCityConfig($house['cityId']);
$community = $this->getCommunity($house['commId']);
if (empty($community) || !$community['sosolat'] || !$community['sosolng']) {
$this->setLog(date('Y-m-d H:i:s') . ' - propId: ' . $house['id'] . ',no around community');
// 更新游标
$this->cursor['id'] = $house['id'];
$this->setFlag($this->cursor);
continue;
}
//两公里经纪人获取------3.7版本以上或者免费城市3.4版本以上
$brokerIds = $this->getBroker2K($house['commId'], $community['sosolat'], $community['sosolng'], $commIds, $pushOpen, $house['id']);
/**
* 板块推送功能关闭,后期将会删除
*/
/*
if (empty($brokerIds)) {
//板块下经纪人-》------3.7版本以上或者免费城市3.4版本以上 如果是测试小区测试经纪人id已经是存在的这里就没判断测试小区。
$brokerIds = $this->areaEntrustBroker($community['areaCode'],$pushOpen,$house['cityId'],$house['id']);
}
*/
if (empty($brokerIds)) {
$this->setLog(date('Y-m-d H:i:s') . ' - propId: ' . $house['id'] . ',commid: ' . $community['commId'] . ',no around broker');
// 更新游标
$this->cursor['id'] = $house['id'];
$this->setFlag($this->cursor);
continue;
}
$tmp = array_values(APF::get_instance()->get_config('test_broker_id', 'apiTestId'));
$brokerIdsArr = $tmp[0];
foreach ($brokerIds as $brokerId) {
$brokerInfoForAjkBrokerExtend = Model_Broker_AjkBrokerExtend::getDataByBrokerId($brokerId);
if (!in_array($brokerId, $brokerIdsArr) && $house['cityId'] != $brokerInfoForAjkBrokerExtend['cityId']) {
$this->setLog(date('Y-m-d H:i:s') . " - house: {$house['id']} and broker: {$brokerId} not in the same city.");
continue;
}
echo '执行队列插入' . "\n";
Model_House_CommissionHousePushed::create(array('userId' => Bll_Broker_MainBusiness::getDataByEsfId($brokerId)->memberId, 'brokerId' => $brokerId, 'propertyId' => $house['id'], 'createTime' => date('Y-m-d H:i:s'), 'propertyStatus' => $house['proStatus'], 'robNum' => $house['openBrokerCnt']))->save();
echo '更新可抢插入' . "\n";
// 更新可抢房源数
$daCommissionHousePushedCount = Model_House_CommissionHousePushedCount::data_access()->filter('brokerId', $brokerId)->find_only();
if (!empty($daCommissionHousePushedCount)) {
$daCommissionHousePushedCount->incrCommissionHousePushedCount();
} else {
Model_House_CommissionHousePushedCount::create(array('brokerId' => $brokerId, 'total' => 1))->save();
}
}
echo '完成' . "\n";
// 更新游标
$this->cursor['id'] = $house['id'];
$this->setFlag($this->cursor);
}
}
示例10: isPpcBroker
/**
* 是否PPC经纪人
* @param $ajkBrokerId
* @return bool
*/
public static function isPpcBroker($ajkBrokerId)
{
$data = Model_Broker_AjkBrokerExtend::getDataByBrokerId($ajkBrokerId);
return $data ? $data->payType == Model_Broker_AjkBrokerExtend::PAY_TYPE_PPC : false;
}
示例11: handle_request
public function handle_request()
{
$adBrokerList = $this->getRequestData();
foreach ($adBrokerList as $val) {
$data = array();
$this->setMyFlag($val['id']);
// $priceList = Bll_Broker_ShowcaseConsumeQuery::getInstance()->getBrokerQuery($val['brokerId'],$this->yDate,$this->nDate,$this->_dateBase);
// $price = 0;
// if($priceList){
// foreach($priceList as $plist){
// $price += $plist['realAccount'];
// }
// }
$priceList = Bll_Broker_ShowcaseConsumeQuery::getInstance()->getBrokerQueryV2($val['brokerId'], $this->yDate, $this->_dateBase);
$price = 0;
if ($priceList) {
foreach ($priceList as $plist) {
$price += $plist['amount'];
}
}
$time = date('Y-m-d 00:10:00', strtotime($this->yDate));
$propList = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerTimeHouse($val['brokerId'], $time, $this->nDate, $this->_dateBase);
$props = $propstmp = array();
if ($propList) {
foreach ($propList as $hlist) {
if (!in_array($hlist['propId'], $props)) {
$props[] = $hlist['propId'];
}
}
}
$tpropList = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerTimeHouse($val['brokerId'], $this->nDate, 0, $this->_dateBase);
if ($tpropList) {
$propstmp = $this->aryMerger($tpropList, $propstmp);
}
$propShowList = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerAdPropShowInfo($val['brokerId'], $this->_dateBase);
if ($propShowList) {
$propstmp = $this->aryMerger($propShowList, $propstmp, 2);
}
if ($propstmp) {
foreach ($propstmp as $newval) {
if ($newval['flag'] != 1) {
if (!in_array($newval['propId'], $props)) {
$props[] = $newval['propId'];
}
}
}
}
$brokerInfo = new Model_Broker_AjkBrokerExtend();
$info = $brokerInfo->getDataByBrokerId($val['brokerId']);
$data['brokerId'] = $val['brokerId'];
$data['cityId'] = $info['cityId'];
$data['dayDate'] = $this->yDate;
$data['createTime'] = time();
$data['updateTime'] = date('Y-m-d H:i:s');
$data['propsSum'] = count($props);
$data['price'] = $price;
$lastid = Bll_Broker_ShowcaseLogs::getInstance()->addAdStatusLog($data, $this->_dateBase);
if (!$lastid) {
$mailSubject = $this->yDate . $this->_dateBaseName . '插入出错问题';
$mailBody = $this->_dateBaseName . '的' . $val['id'] . ',经纪人id:' . $val['brokerId'] . '执行时间:' . date('Y-m-d H:i:s');
Bll_Broker_ShowcaseCommon::getInstance()->sendMail($mailSubject, $mailBody, $this->mailArr);
}
}
}