本文整理汇总了PHP中APF类的典型用法代码示例。如果您正苦于以下问题:PHP APF类的具体用法?PHP APF怎么用?PHP APF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了APF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_view
public function get_view()
{
$req = APF::get_instance()->get_request();
$data = $req->get_attributes();
$this->assign_data("data", $data);
return "Header";
}
开发者ID:emilymwang8,项目名称:supplierchannel,代码行数:7,代码来源:Header.php
示例2: execute
public function execute()
{
$this->apf = APF::get_instance();
$this->request = $this->apf->get_request();
$this->response = $this->apf->get_response();
$attributes = $this->request->get_attributes();
if (!empty($attributes)) {
foreach ($attributes as $key => $value) {
$this->assign_data($key, $value);
}
}
parent::execute();
}
开发者ID:emilymwang8,项目名称:cntspeed50,代码行数:13,代码来源:Decorator.php
示例3: handle_request_internal
public function handle_request_internal()
{
// @params proids :房源id 多个id以逗号间隔如22,33,44【必填】
// @params brokerId :经纪人id【必填】
// @params token :token【必填】
// @params from :请求来源【必填】
$paramsApi['from'] = APF::get_instance()->get_config('java_api_from');
$paramsApi['proids'] = $this->_params['propIds'];
$paramsApi['token'] = $this->_params['token'];
$paramsApi['brokerId'] = $this->_params['brokerId'];
$brokerId = $this->_params['brokerId'];
//判断经纪人为ppc经纪人 & 套餐经纪人
//根据不同类型判断调用不同的java接口
if (Bll_Broker_HzBroker::isComboBroker($brokerId)) {
$paramsApi['isComboBroker'] = true;
$api_url = 'sale/properties/deletes?json';
} else {
$paramsApi['isComboBroker'] = false;
$api_url = 'ppc/properties/deletes?json';
}
$data = Util_CallAPI::callJavaInternalApi($api_url, $paramsApi, false);
if ($data['data']['status'] === 'ok') {
$ret = array('status' => 'ok', 'data' => array());
} else {
$errcode = $data['data']['code'];
$translate_errcode = $this->my_err_code($errcode);
return Util_MobileAPI::error($translate_errcode);
}
return $ret;
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:30,代码来源:DelProps.php
示例4: initEnv
private function initEnv()
{
$this->objAPF = $objAPF = APF::get_instance();
$this->request = $this->objAPF->get_request();
$this->params = $this->request->get_parameters();
$this->debug = isset($_GET['debug']) ? true : false;
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:7,代码来源:Api.php
示例5: handle_request_internal
public function handle_request_internal()
{
$request = APF::get_instance()->get_request();
$brokerId = self::$BrokerInfo['BaseInfo']['BROKERID'];
$cityId = self::$BrokerInfo['BaseInfo']['CITYID'];
try {
$starBll = new Bll_Broker_StarIntermediary($cityId);
$starIsOpen = $starBll->checkCityIfOpen();
if ($starIsOpen) {
$starInfo = $starBll->getBrokerNewestInfo($brokerId);
$brokerScore = $starInfo['broker']['brokerScore'] ?: 0;
$maxScore = $starInfo['city']['cityScore'] ?: 0;
$leftScore = $maxScore - $brokerScore > 0 ? $maxScore - $brokerScore : 0;
$clickScoreRate = sprintf("%.1f", $starInfo['city']['vppvBeishu'] ?: 0);
$isStar = $starInfo['broker']['isMingxing'] ?: 0;
$request->set_attribute('brokerScore', $brokerScore);
$request->set_attribute('maxScore', $maxScore);
$request->set_attribute('leftScore', $leftScore);
$request->set_attribute('clickScoreRate', $clickScoreRate);
$request->set_attribute('isStar', $isStar);
} else {
//todo 产品没有定义错误页面,工期太赶,没有时间处理
return;
}
} catch (Exception $e) {
//todo 不做任何处理
return;
}
return "Broker_StarIntermediary";
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:30,代码来源:StarIntermediary.php
示例6: get_userinfo_from_ldap
public function get_userinfo_from_ldap($username, $password)
{
$config = @APF::get_instance()->get_config('ldap', 'ldap');
$url = $config['url'];
if ($config['host'] && $config['port']) {
$ldaphost = $config['host'];
$ldapport = $config['port'];
$data = array('u' => $username, 'p' => $password, 'f' => 'getinfo', 'host' => $ldaphost, 'port' => $ldapport);
} else {
$data = array('u' => $username, 'p' => $password, 'f' => 'getinfo');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$login = json_decode(curl_exec($ch), true);
curl_close($ch);
$ldap_info = false;
if ($login['result']) {
$info = $login['result'];
for ($i = 0; $i < $info['count']; $i++) {
$ldap_info = new stdClass();
$ldap_info->chinese_name = $info[$i]['displayname'][0];
$ldap_info->english_name = $info[$i]['samaccountname'][0];
$ldap_info->email = $info[$i]['mail'][0];
}
}
return $ldap_info;
}
开发者ID:emilymwang8,项目名称:ibug,代码行数:31,代码来源:LdapBiz.php
示例7: handle_request_internal
public function handle_request_internal()
{
$request = APF::get_instance()->get_request();
$response = APF::get_instance()->get_response();
$routeMatches = $request->get_router_matches();
$business = $routeMatches[1];
$response->set_content_type('text/html', 'utf-8');
switch ($business) {
case 'ajk':
return new House_PublishAjkController();
break;
case 'hz':
return new House_PublishHzController();
break;
case 'jpor':
return new House_ORPublishJpController();
break;
case 'jpos':
return new House_OSPublishJpController();
break;
case 'jpsr':
return new House_SRPublishJpController();
break;
case 'jpss':
return new House_SSPublishJpController();
break;
default:
return new House_PublishAjkController();
break;
}
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:31,代码来源:PublishAll.php
示例8: handle_request_internal
public function handle_request_internal()
{
$apf = APF::get_instance();
$request = $apf->get_request();
$act = $request->get_parameters();
//操作类型
$account = $act['ac'];
$acOrderNo = $act['or'];
$sn = $act['sn'];
$amount = $act['am'];
$ack = $act['ack'];
$price = $act['price'];
$userId = $act['userId'];
$reorderId = $act['reorderId'];
$apps = APF::get_instance()->get_config('apps', 'acenter');
$appId = $apps['fyk']['appId'];
$appKey = $apps['fyk']['appKey'];
$myAck = md5("ac=" . $account . "&ap=" . $appId . "&or=" . $acOrderNo . "&sn=" . $sn . "&am=" . $amount . "&appkey=" . $appKey . "");
if (empty($ack)) {
// 判断是callback通知
$callBackUrl = APF::get_instance()->get_config('wabRechargeSuccessUrl');
$this->redirect($callBackUrl . "?amount=" . $price / 100);
} elseif ($myAck == $ack) {
// 判断是notify通知
return $this->isNotify($reorderId, $userId, $account, $price, $amount * 100, $acOrderNo);
}
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:27,代码来源:RechargeNotify.php
示例9: upLoadQrImage
public function upLoadQrImage($username)
{
//获取 上传
$url = 'http://open.weixin.qq.com/qr/code/?' . http_build_query(array('username' => $username));
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$file = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
if (!in_array($info['content_type'], array('image/jpg', 'image/png', 'image/jpeg'))) {
return false;
} else {
// 上传至 AIS
$upLoadURLPrefixDFS = APF::get_instance()->get_config('ImageUploadURLPrefixDFS', 'image');
$upLoadURLBaseDomainDFS = APF::get_instance()->get_config('ImageUploadURLBaseDomainDFS', 'image');
$upLoad = $upLoadURLPrefixDFS . '.' . $upLoadURLBaseDomainDFS . '/upload';
$bs64 = base64_encode($file);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $upLoad);
// TODO 注意该路径走配置
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file' => $bs64));
$ret = curl_exec($ch);
curl_close($ch);
$ret = json_decode($ret, true);
if ($ret['status'] != 'ok') {
return false;
}
return $ret;
}
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:33,代码来源:LightenWeChatName.php
示例10: handle_request_internal
public function handle_request_internal()
{
if (!isset($this->_params["propId"])) {
return Util_MobileAPI::error(Const_APIStatus::E_PROP_ID_MISS);
}
$json = $this->_params['imageJson'];
//$json = '[{"type":3,"commPicIds":12345}]';
$imageJson = json_decode($json, true);
if ($imageJson) {
$proid = $this->_params["propId"];
foreach ($imageJson as $img) {
$api_url = 'image/addImg';
$img_params['brokerId'] = $this->_params['brokerId'];
$img_params['propId'] = $proid;
$img_params['imageJson'] = json_encode($img);
$img_params['from'] = APF::get_instance()->get_config('java_api_from');
$img_params["token"] = $this->_params["token"];
//token
ksort($img_params);
$img_params_json = json_encode($img_params);
$img_return = Util_CallAPI::get_data_from_java_v3($api_url, $img_params_json, false);
if ($img_return['data']['status'] != 'ok' && !$img_return['data']['id']) {
return Util_MobileAPI::error(Bll_Prop::changeJavaAPICodeToSelfCode($img_return['data']['code']));
}
}
} else {
return Util_MobileAPI::error(Const_APIStatus::E_PROP_IMAGEJSON_ERROR);
}
$return = array();
$return["status"] = "ok";
$return['data']['id'] = $img_return['data']['id'];
return $return;
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:33,代码来源:AddImg.php
示例11: handle_request_internal
public function handle_request_internal()
{
if (!Bll_City::isShowCaseCity(static::$intBrokerCityID)) {
$this->outData(array(), 0);
exit;
}
$this->apf = APF::get_instance();
$this->request = $this->apf->get_request();
$this->response = $this->apf->get_response();
$params = $this->request->get_parameters();
//经纪人ID
$this->brokerId = self::$BrokerInfo['BaseInfo']['BROKERID'];
// TODO 替换为其他的方式
//经纪人城市ID
$this->cityId = self::$BrokerInfo['BaseInfo']['CITYID'];
$type = $params['type'];
switch ($type) {
case 'esf':
//二手房房源数据获取
$this->getBrokerEsfPro();
break;
case 'zf':
//租房房源数据获取
$this->getBrokerZfPro();
break;
default:
$this->outData(array(), 0);
break;
}
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:30,代码来源:GetProInfo.php
示例12: _checkSave
private function _checkSave()
{
// 验证ip是否合法
$clientIp = APF::get_instance()->get_request()->get_client_ip();
$configIp = APF::get_instance()->get_config('active_coupon_ip', 'customer');
return $clientIp == $configIp ? true : false;
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:7,代码来源:ActiveCoupon.php
示例13: handle_request_internal
public function handle_request_internal()
{
if (!isset($this->_params['cityId'])) {
return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS);
}
// 房屋类型 junyang
$protype = APF::get_instance()->get_config('housetype', 'zu_house');
$protype = isset($protype[$this->_params['cityId']]) ? $protype[$this->_params['cityId']] : $protype[0];
// 装修类型
$fitments = APF::get_instance()->get_config('ajk_fitment_unify', 'zu_house');
$fitment = $fitments[$this->_params['cityId']];
// 选择朝向
$toward = APF::get_instance()->get_config('toward', 'zu_house');
// 房屋配置
$deployment = APF::get_instance()->get_config('b_deployment', 'zu_house');
// 付款类型
$paytype = APF::get_instance()->get_config('paytype', 'zu_house');
// 合租类型
$sharetype = APF::get_instance()->get_config('sharetype', 'zu_house');
// 合租性别
$sharesex = APF::get_instance()->get_config('sharesex', 'zu_house');
//是否播种城市
$isseed = 0;
$cityTop = Bll_HzFixPlan::get_citytop($this->_params['cityId']);
if (!empty($cityTop)) {
$isseed = 1;
}
$return = array();
$return["status"] = "ok";
$return["data"] = array("protype" => $protype, "fitment" => $fitment, "toward" => $toward, "deployment" => $deployment, "paytype" => $paytype, "sharetype" => $sharetype, "sharesex" => $sharesex, 'isseed' => $isseed);
return $return;
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:32,代码来源:GetConfig.php
示例14: execute
public function execute($input_parameters = NULL)
{
if (APF::get_instance()->is_debug_enabled()) {
APF::get_instance()->debug(__CLASS__ . '[' . $this->pdo->config['dsn'] . '|' . $this->pdo->get_name() . ']' . "->execute: " . $this->queryString);
}
$logger = APF::get_instance()->get_logger();
$logger->debug(__CLASS__, '[' . $this->pdo->get_name() . ']->execute: ', $this->queryString);
APF::get_instance()->pf_benchmark_inc_begin('dbtime');
$start = microtime(true);
$ret = parent::execute($input_parameters);
$end = microtime(true);
APF::get_instance()->pf_benchmark_inc_end('dbtime');
//add by hexin for record SQL execute time
APF::get_instance()->pf_benchmark("sql_time", array($this->i => $end - $start));
// 按照惯用格式记录sql执行时间和占用内存
// added by htlv
$tmp_time = $end - $start;
$tmp_mem = memory_get_usage();
apf_require_class('APF_Performance');
APF::get_instance()->pf_benchmark("sql_time_af", array($this->i => array('sql' => $this->_sql, APF_Performance::MESSAGE_TIME => $tmp_time, APF_Performance::MESSAGE_MEMORY => $tmp_mem)));
if (!$ret) {
$error_info = parent::errorInfo();
/**
* remove duplicated error log
$logger->error(__CLASS__, '['. $this->pdo->get_name() .']->execute: ', $this->queryString);
$_error_info = preg_replace("#[\r\n \t]+#",' ',print_r($error_info,true));
$logger->error(__CLASS__, '['. $this->pdo->get_name() .']->execute: ', $_error_info);
*/
if (parent::errorCode() !== '00000') {
throw new APF_Exception_SqlException($this->pdo->get_name() . ' | ' . $this->pdo->config['dsn'] . ' | ' . $this->queryString . ' | ' . join(' | ', $error_info), parent::errorCode());
}
}
return $ret;
}
开发者ID:emilymwang8,项目名称:cms,代码行数:34,代码来源:PDOStatement.php
示例15: handle_request
public function handle_request()
{
$apf = APF::get_instance();
$request = $apf->get_request();
$params = $request->get_parameters();
$baseDomain = $apf->get_config('base_domain', 'common');
$baseUri = defined('BASE_URI') ? BASE_URI : '';
$showUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/show";
$win = Model_Goodbroker_Baseinfo::data_access()->filter('is_deem', 1)->filter('top_ten', 1)->limit(10)->find_all();
$gbdao = new Bll_Goodbroker();
$vcrres = $gbdao->getResourceDAO();
$winids = '';
foreach ($win as $row) {
$winids .= $row->broker_id . ',';
}
$winids = substr($winids, 0, -1);
$vcrarr = $vcrres->getVcr($winids);
$varr = array();
foreach ($vcrarr as $row) {
$varr[$row['broker_id']] = $row['resource_url'];
}
$request->set_attribute('win', $win);
$request->set_attribute('varr', $varr);
$request->set_attribute('showUrl', $showUrl);
return 'Goodbroker_Win';
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:26,代码来源:Win.php
示例16: handle_request_internal
public function handle_request_internal()
{
$request = APF::get_instance()->get_request();
$params = $request->get_parameters();
$city = $params['city'];
$company = $params['company'];
$storeName = $params['kw'];
$storeName = sprintf('%%%s%%', $storeName);
$area_id = $params['areaid'];
$block_id = $params['block_id'];
$type = $params['type'];
if ($block_id == 0) {
$areacode = 0;
} else {
// 根据type 获取areacode.
$type = intval($type);
$rst = DAO_Common_common::getCommTypeDetail($type);
$areacode = @$rst['TYPECODE'];
}
$storeList = Model_Broker_AjkCstBrokerCompany::getStoreListByKeyword($company, $city, $storeName);
$store = array();
$other = array('id' => 0, 'name' => '其他门店', 'AreaId' => 0, 'AreaName' => null, 'BlockId' => 0, 'BlockName' => null);
array_push($store, $other);
foreach ($storeList as $k => $v) {
//$area = DAO_Common_common::getAreaInfo(substr($v['areaCode'], 0, 8));
//$block = DAO_Common_common::getAreaInfo($v['areaCode']);
$block = Model_City_TypeCode::getAreaInfo($v['areaCode']);
$area = Model_City_TypeCode::getAreaInfoByTypeIdEx($block['parentId']);
$swap = array('id' => $v['comanyId'], 'name' => $v['comanyName'], 'AreaId' => $area['typeId'], 'AreaName' => $area['typeName'], 'BlockId' => $block['typeId'], 'BlockName' => $block['typeName']);
array_push($store, $swap);
}
echo json_encode($store);
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:33,代码来源:StoreList.php
示例17: handle_request_internal
public function handle_request_internal()
{
$this->apf = APF::get_instance();
$this->request = $this->apf->get_request();
$this->response = $this->apf->get_response();
$this->params = $this->request->get_parameters();
$act = trim($this->params['act']);
$brokerId = self::$BrokerInfo['BaseInfo']['BROKERID'];
$cityId = self::$BrokerInfo['BaseInfo']['CITYID'];
/*
if($cityId == 11){
APF::get_instance()->get_response()->redirect('/ajkbroker/commissions/mysale');
return false;
}
*/
switch ($act) {
case 'checkConsume':
$this->checkConsume($brokerId, $cityId);
break;
default:
echo json_encode("非法请求");
exit;
break;
}
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:25,代码来源:Rush.php
示例18: handle_request_internal
public function handle_request_internal()
{
//$stime=microtime(true);
$this->apf = APF::get_instance();
$this->request = $this->apf->get_request();
$this->response = $this->apf->get_response();
$params = $this->request->get_parameters();
$brokerId = self::$BrokerInfo['BaseInfo']['BROKERID'];
// TODO 替换为其他的方式
$result = array('status' => 0, 'data' => array(), 'errorMsg' => "");
// 必须使用POST请求
if (!$this->request->is_post_method()) {
$result['errorMsg'] = "请使用POST请求。";
}
$houseId = $params['id'];
$brokerName = self::$BrokerInfo['BaseInfo']['TRUENAME'];
$brokerPhone = self::$BrokerInfo['BaseInfo']['USERMOBILE'];
$cityId = self::$BrokerInfo['BaseInfo']['CITYID'];
/*
if($cityId == 11){
APF::get_instance()->get_response()->redirect('/ajkbroker/commissions/mysale');
return false;
}
*/
$isComboCity = Bll_Combo_HouseRelation::ifComboCity($cityId);
$saleRushResult = Bll_Broker_EntrustQuery::getInstance()->saleRush($houseId, $brokerId, $brokerName, $brokerPhone, $cityId, Const_Entrust::RUSH_FROM_PC, true, $isComboCity);
$result = array('status' => $saleRushResult['status'], 'data' => $saleRushResult['data'], 'errorMsg' => $saleRushResult['errorMsg']);
echo json_encode($result);
exit;
/* $etime=microtime(true);//获取程序执行结束的时间
$total=$etime-$stime; //计算差值
echo "<br />{$total} times";*/
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:33,代码来源:SaleRush.php
示例19: insertLoginLog
/**
* 插入经纪人登录日志
*
* @param int $splitSuffix
* @return array
*/
public static function insertLoginLog($userid, $usertype = 1)
{
//变量定义
$timestamp = time();
$date = date('Ymd');
$sql = sprintf("select LogId from `%s` where UserId=" . $userid . " and LoginDate='" . $date . "' and LoginFlag=1 limit 1", self::TABLE_NAME);
$oModel = Model_Log_BrokerLogin::data_access();
try {
$logInfo = $oModel->native_sql($sql, array());
} catch (Exception $e) {
$logInfo = array();
}
if (is_arrya($logInfo) && count($logInfo)) {
$logFlag = 0;
} else {
$logFlag = 1;
}
$ip = APF::get_instance()->get_request()->get_client_ip();
$remote_port = intval($_SERVER['REMOTE_PORT']);
$sqlInsert = sprintf("insert into `%s` (LogId,UserId,UserType,LoginTime,LoginDate,LoginFlag)) values('','{$userid}','{$usertype}','{$timestamp}','{$date}','{$logflag}')", static::getTableName($splitSuffix));
try {
$rowCount = $oModel->native_sql($sqlInsert, array(), false);
return 1 == $rowCount;
} catch (Exception $e) {
return false;
}
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:33,代码来源:CompanyLogin.php
示例20: preparePropInfo
private static function preparePropInfo(&$out)
{
$out['propInfo'] = Bll_House_JpHouseInfo::getHouseInfoExt($out['proId']);
if ($out['propInfo']['info']['isDelete'] == 1) {
//房源删除 跳转管理页面
APF::get_instance()->get_response()->redirect('/ajkbroker/combo/broker/manage/jp');
}
// 获取房源图片数 默认图片url
$imageInfo = BLL_House_JpHouseManage::getPropImageInfo($out['proId'], $out['propInfo']['houseType']);
$out['imgInfo'] = $imageInfo;
//获取物业名称
$propertyId = $out['propInfo']['houseType'] > 2 ? $out['propInfo']['info']['propertyId'] : $out['propInfo']['info']['buildingId'];
$propertyInfo = Model_House_JpProperty::data_access()->filter('id', intval($propertyId))->get_row();
$out['propertyName'] = $propertyInfo['name'];
//房源的最近七天点击量/花费
$clickAll = BLL_House_JpHouseManage::get7DaysHouseClick($out['proId']);
//套餐房源点击量
$comboClick = array();
if ($out['isComboBroker']) {
$comboClickInfo = Bll_Combo_Broker_BrokerComboInfo::getHouseComboClickEx($out['proId'], date('Y-m-d', strtotime('-6 days')), date('Y-m-d'), Model_Ppc_NewPackageStatsHouseDay::SITE_TYPE_JP);
$comboClick = $comboClickInfo[$out['proId']];
//var_dump($comboClick);die;
}
$out['comboClick'] = $comboClick;
$out['clickAndCost'] = $clickAll;
}
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:26,代码来源:JpPropView.php
注:本文中的APF类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论