本文整理汇总了PHP中Model_Broker_AjkBrokerExtend类的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend类的具体用法?PHP Model_Broker_AjkBrokerExtend怎么用?PHP Model_Broker_AjkBrokerExtend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Model_Broker_AjkBrokerExtend类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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']);
}
}
示例3: getBrokerClickAndCostDay
/**
* 获取经纪人一天的点击和话费
* 直接为controller调用
*
* @param $brokerId
* @param $datei
* @return array|bool
*/
public function getBrokerClickAndCostDay($brokerId, $datei, $cityId = false)
{
try {
if (!$cityId) {
//获取经纪人基本信息
$brokerBaseInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
if (empty($brokerBaseInfo)) {
$this->error(bll_choice_EsfAPPAPIChoice::EMPTY_BROKER_ERROR, bll_choice_EsfAPPAPIChoice::EMPTY_BROKER_ERROR_MSG);
}
$cityId = $brokerBaseInfo->cityId;
}
//获取点击和花费信息
$data = array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元');
$allClickAndCostInfo = Model_Plan_HpProStatsDay::getBrokerClickAndCostDay($brokerId, $cityId, $datei);
foreach ($allClickAndCostInfo as $row) {
$data['todayClicks'] += $row->cnum;
$data['todayConsume'] += $row->amount / 100;
}
return $data;
} catch (Exception $e) {
if ($e instanceof Exception_BllErrorException) {
$this->errorCode = $e->getCode();
} else {
$this->errorCode = bll_choice_EsfAPPAPIChoice::UNKNOW_ERROR;
}
$this->errorMsg = $e->getMessage();
return false;
}
}
示例4: 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);
}
示例5: 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' => '恭喜你,已点亮微信号展示'));
}
示例6: 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));
}
示例7: handle_request
public function handle_request()
{
$this->__logFile = sprintf('/home/www/logs/User_ImportUserInfo-%s.log', date('Ymd'));
if (file_exists($this->__idFile) && is_readable($this->__idFile)) {
$this->startId = intval(file_get_contents($this->__idFile));
}
$index = 1;
$pageSize = 1000;
while (true) {
echo "开始导入第{$index}批经纪人信息, 起始BrokerId={$this->startId}\n";
$brokerList = Model_Broker_AjkBrokerExtend::scanBroker($this->startId, $pageSize);
if (empty($brokerList)) {
break;
}
foreach ($brokerList as $broker) {
$this->startId = $broker['brokerId'];
file_put_contents($this->__idFile, $this->startId);
file_put_contents($this->__logFile, "{$index}: 导入经纪人: {$broker['trueName']}\tBrokerId: {$broker['brokerId']}\tUserId: {$broker['userId']}\n", FILE_APPEND);
/** $aid,$user_id,$broker_id,$city_id,$user_name,$gender,$phone,$properties,$origin_properties,$grade_score,$grade_level */
Bll_Cms_ActivityUserProperty::add_broker(1, $broker['userId'], $broker['brokerId'], $broker['cityId'], $broker['trueName'], $broker['gender'] == 1 ? 0 : 1, $broker['userMobile'], $broker['gradeScore'], $broker['gradeScore'], $broker['gradeScore'], $broker['gradeLevel']);
}
$index++;
}
echo "导入经纪人信息完成,结束BrokerId={$this->startId}\n";
}
示例8: 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;
}
示例9: 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;
$userCardStatus = 0;
if ($usrCardState == 2) {
$userCardStatus = 1;
//已认证
}
//头像
$userPhoto = $brokerInfo->userPhoto;
$usrPhotoState = $brokerInfo->usrPhotoState;
$usrPhotoTmpState = $brokerInfo->usrPhotoTmpState;
$photoStaus = 0;
$imageUrl = '';
if ($usrPhotoState == 2 || $usrPhotoTmpState == 1) {
$photoStaus = 1;
//已认证
$imageUrl = Util_DisplayImages::get_img_url($userPhoto, -1, '100x133');
}
if ($photoStaus == 1 && $userCardStatus == 1) {
$status = 1;
//双证通过
} else {
$status = 0;
//双证未通过审核
}
return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => $status, 'userPhotoPassUrl' => $imageUrl));
}
示例10: 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));
}
示例11: 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;
}
示例12: 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));
}
示例13: 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;
}
示例14: handle_request
/**
* Job执行逻辑
*/
public function handle_request()
{
//记录调用api参数
printf('[%s] lastLogId: %s' . PHP_EOL, date('Y-m-d H:i:s'), $this->lastLogId);
$logs = $this->getLogList();
if (!empty($logs)) {
foreach ($logs as $log) {
//记录游标
$this->setFlag(array('id' => $log['id']));
if ($log['changeType'] == 1) {
continue;
}
$couponInfo = $this->getCouponInfo($log['brokerCouponId']);
if (!empty($couponInfo)) {
$data = array();
$data['changeType'] = 0;
if ($log['changeType'] == 2) {
$data['changeType'] = 1;
} elseif ($log['changeType'] == 3) {
$data['changeType'] = 2;
}
$data['brokerId'] = $log['brokerId'];
$data['num'] = $log['num'];
$data['changeTime'] = $log['createTime'];
$data['price'] = $couponInfo['disPrice'] / $couponInfo['totalNum'] * $data['num'];
//消耗的券价值多少
$data['realPrice'] = $data['price'];
$cityInfo = Model_Broker_AjkBrokerExtend::data_access()->load_field('cityId')->filter('brokerId', $data['brokerId'])->get_row();
$data['cityId'] = $cityInfo['cityId'];
Model_KuaiJi_CustomerBrokerCouponConsume::create($data)->save();
}
}
}
}
示例15: checkUsernameAndPassword
/**
* 用户名密码check
* 1、判断用户名密码是否为空
* 2、判断用户明是否手机号码
* 3、查询用户信息(用户名或手机号码)
* 4、判断密码是否正确
* 5、返回用户信息
*
* @param $UserName
* @param $PassWord
* @return bool|int
*/
public static function checkUsernameAndPassword($userName, $passWord)
{
$userName = trim($userName);
$passWord = trim($passWord);
//判断用户名密码是否为空
if (empty($userName) || empty($passWord)) {
return self::getMsg(array('msg' => '用户名、密码不能为空!'));
}
//查询用户信息(手机号码)
$userInfo = array();
$userInfo = Model_Broker_Member::getAjkMemberByUserName($userName);
if (empty($userInfo)) {
$brokerInfo = Model_Broker_AjkBrokerExtend::getBrokerInfoByMobileV2($userName);
if ($brokerInfo) {
$userInfo = Model_Broker_Member::getAjkMembersByUserId($brokerInfo['userId']);
}
}
if (empty($userInfo)) {
$userInfo = Model_Broker_Member::getAjkMemberByEmail($userName);
}
//判断密码是否正确
if (empty($userInfo)) {
return self::getMsg(array('msg' => '用户名或密码错误'));
}
if ($userInfo['userPwd'] != base64_encode(md5($passWord))) {
return self::getMsg(array('msg' => '用户名或密码错误!'));
}
//返回用户信息
return self::getMsg($userInfo, true);
}