Example #1
1
 public function get_view()
 {
     $req = APF::get_instance()->get_request();
     $data = $req->get_attributes();
     $this->assign_data("data", $data);
     return "Header";
 }
Example #2
0
 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();
 }
Example #3
0
 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;
 }
Example #4
0
 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;
 }
 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";
 }
Example #6
0
 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;
 }
Example #7
0
 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;
     }
 }
 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);
     }
 }
 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;
     }
 }
Example #10
0
 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;
 }
Example #11
0
 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;
     }
 }
Example #12
0
 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;
 }
Example #13
0
 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;
 }
Example #14
0
 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;
 }
Example #15
0
 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';
 }
Example #16
0
 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);
 }
Example #17
0
 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;
     }
 }
Example #18
0
 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";*/
 }
Example #19
0
 /**
  * 插入经纪人登录日志
  *
  * @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;
     }
 }
Example #20
0
 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;
 }
Example #21
0
 public function change_status($status, $input_arr)
 {
     $new_reporter = APF::get_instance()->get_request()->get_username();
     $new_ticket = array('priority' => $this->ticket->priority, 'reporter' => $new_reporter, 'owner' => $this->ticket->owner, 'assigned_qa' => $this->ticket->assigned_qa, 'status' => 'opened', 'summary' => $this->ticket->summary, 'pmt_id' => $this->ticket->pmt_id, 'environment' => $this->ticket->environment, 'department' => $this->ticket->department, 'component' => $this->ticket->component, 'version' => $this->ticket->version, 'is_regression' => $this->ticket->is_regression, 'description' => $this->ticket->description, 'resolution' => '', 'reason' => '', 'reason_detail' => '');
     $new_ticket_id = Bll_TicketBiz::get_instance()->ticket_add($new_ticket);
     if ($input_arr['comments']) {
         $current_time = date("Y-m-d H:i:s");
         $log_id_comment = Bll_TicketLogBiz::get_instance()->comment_add($new_ticket_id, $input_arr['comments'], $new_reporter, $current_time);
     }
     $parent_ticket_id = $this->ticket->id;
     $relation = Bll_TicketRelationBiz::get_instance()->find_root_by_parent($parent_ticket_id);
     if ($relation) {
         $root_ticket_id = $relation->root_ticket_id;
     } else {
         $root_ticket_id = $parent_ticket_id;
     }
     $new_relation = array();
     $new_relation['ticket_id'] = $new_ticket_id;
     $new_relation['parent_ticket_id'] = $parent_ticket_id;
     $new_relation['root_ticket_id'] = $root_ticket_id;
     $success = Bll_TicketRelationBiz::get_instance()->relation_add($new_relation);
     //return $success;
     if ($success) {
         //reopen log add
         $current_time = date("Y-m-d H:i:s");
         $input_arr_log = array('ticket_id' => $new_ticket_id, 'created_by' => $new_reporter, 'field' => 'ticket', 'oldvalue' => 'null', 'newvalue' => $new_ticket['description'], 'created_at' => $current_time);
         $log_id = Bll_TicketLogBiz::get_instance()->log_add($input_arr_log);
         $location = Ticket_DetailController::build_uri() . "?ticket_id=" . $new_ticket_id;
         APF::get_instance()->get_response()->redirect($location);
     }
 }
Example #22
0
 public function handle_request()
 {
     //todo 时间限制打开
     if (time() < strtotime("2013-12-16 00:00:00")) {
         APF::get_instance()->get_response()->redirect(Uri_ChristmasUrl::advance_url());
     }
     //是否登录
     $broker_id = APF::get_instance()->get_request()->getBrokerId();
     if (!$broker_id) {
         $current_url = APF::get_instance()->get_request()->get_request_url();
         $login_url = Uri_ChristmasUrl::login_url($current_url);
         $this->setAttribute('login_url', $login_url);
     }
     //愿望列表
     $wish_list = Model_Christmas_BrokerWish::get_wish_list($broker_id);
     //愿望滚动列表
     $limit = 100;
     $wish_list_scroll = Model_Christmas_BrokerWish::get_wish_list_scroll($limit);
     //获奖名单
     //$award_list = Model_Christmas_WishAward::get_award_list();
     $award_list = array('孙绍光 137****9280 (北京) 获得 移动电源', '叶剑锋 136****6215 (上海) 获得 移动电源', '王毓秀 151****0593 (苏州) 获得 移动电源', '谢超华 132****1293 (郑州) 获得 移动电源', '杨红伟 189****5973 (成都) 获得 移动电源', '曾美林 186****6391 (杭州) 获得 移动电源', '沈政 182****9657 (上海) 获得 剃须刀', '李淑园 139****4069 (大连) 获得 移动电源', '缪宏冰 137****1143 (福州) 获得 剃须刀', '林俊泉 136****8440 (深圳) 获得 移动电源', '周燕芳 186****1587 (长沙) 获得 移动电源', '杨玉梅 159****2794 (珠海) 获得 移动电源', '刘智聪 180****9828 (厦门) 获得 剃须刀', '王甲甲 135****9917 (青岛) 获得 移动电源', '冉学文 151****7214 (重庆) 获得 移动电源', '李红   182****8269 (南京) 获得 移动电源', '陈勇鑫 135****0959 (广州) 获得 剃须刀', '李彦龙 182****6207 (上海) 获得 移动电源', '李鑫博 155****4944 (天津) 获得 移动电源', '张海洋 182****1449 (北京) 获得 剃须刀');
     //是否显示许愿框
     //是否发表过
     $my_wish = Model_Christmas_BrokerWish::get_my_wish($broker_id);
     $broker_flag = empty($my_wish) ? true : false;
     $this->setAttribute('broker_id', $broker_id);
     $this->setAttribute('wish_list', $wish_list['text']);
     $this->setAttribute('wish_list_scroll', $wish_list_scroll);
     $this->setAttribute('broker_flag', $broker_flag);
     $this->setAttribute('award_list', $award_list);
     return 'Christmas_Wish';
 }
Example #23
0
 /**
  * Returns APF instance.
  *
  * @return APF The instance of APF
  */
 public static function &get_instance()
 {
     if (!self::$instance) {
         self::$instance = new APF();
     }
     return self::$instance;
 }
Example #24
0
 /**
  * @return APF_MQ_Stomp
  */
 public function load_stomp($name = "default")
 {
     $cfg = APF::get_instance()->get_config($name, 'mq');
     apf_require_class('APF_MQ_Stomp');
     $stomp = new APF_MQ_Stomp($cfg['uri']);
     return $stomp;
 }
Example #25
0
 public function handle_request_internal()
 {
     $req = APF::get_instance()->get_request();
     //$res    = APF::get_instance()->get_response();
     $params = $req->get_parameters();
     $pro = $params['pro'] ? $params['pro'] : 'all';
     $user_id = $req->get_user_id();
     $departments = Bll_DdCommonBiz::get_instance()->get_departments_for_user_group();
     $groups = Bll_UserGroupCustomBiz::get_instance()->get_all_groups();
     $input_arr = array('type_key' => 'page', 'type_value' => $pro);
     $page_bind_groups = Bll_ReportGroupSelectedBiz::get_instance()->get_group_ids_arr($input_arr);
     foreach ($departments as $value) {
         if (intval($value->value) < 17 || intval($value->value) > 26) {
             $department[$value->value] = $value->name;
         }
     }
     foreach ($groups as $value) {
         $group[$value->department][] = array('name' => $value->group_name, 'id' => $value->id);
     }
     $tab_info = array('all' => array('name' => 'ALL', 'click' => false), 'mobile' => array('name' => 'Mobile', 'click' => false), 'pc' => array('name' => 'Pc', 'click' => false));
     $tab_info[$pro]['click'] = true;
     $req->set_attribute('tab_info', $tab_info);
     $req->set_attribute('department', $department);
     if ($group != null) {
         $req->set_attribute('group', $group);
     }
     $req->set_attribute('user_id', $user_id);
     if (!empty($page_bind_groups) || strlen($page_bind_groups[0]) > 0) {
         $req->set_attribute('page_bind_groups', $page_bind_groups);
     }
     $req->set_attribute('department_id', $department_id);
     return 'NewReport_UserOnlineBug';
 }
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $cityId = $this->_params['cityId'];
     //二手房
     $ajk_ppc_info = Bll_BrokerInfoApp::get_broker_ppc_info($brokerId);
     //租房
     $hz_ppc_info = Bll_BrokerInfoApp::get_broker_ppc_info_hz($brokerId, $cityId);
     //经纪人基础信息
     $brokerBaseInfo = Bll_BrokerInfoApp::get_broker_baseinfo_simple($brokerId);
     try {
         $chatInfo = Bll_Mobile_ChatInfoBll::getInstance()->getChatInfo($brokerId, 1);
         $chatId = $chatInfo['data']['chatId'];
         $twoCodeIcon = $chatInfo['data']['twoCodeIcon'];
     } catch (Exception $e) {
         $chatId = '';
         $twoCodeIcon = '';
     }
     //get bid flg for city
     $choiceCityFlag = Bll_City::isChoiceCity($cityId);
     // chat_token
     $info = array('phone' => $brokerBaseInfo['phone'], 'user_id' => $chatInfo['data']['chatId'], 'device' => array('app_name' => APF::get_instance()->get_config('java_api_from'), 'os' => $this->_params["o"], 'macid' => $this->_params["macid"], 'udid2' => $this->_params["udid2"]));
     $privateKey = APF::get_instance()->get_config('aes_private_key', 'mobile_api');
     $iv = APF::get_instance()->get_config('aes_iv', 'mobile_api');
     $token3rd = Util_CryptUtil::aes_encode($privateKey, $iv, $info);
     $ajk_dic_info = array('ajkClick' => $ajk_ppc_info['ajkClick'], 'ajkConsume' => $ajk_ppc_info['ajkConsume'], 'ajkFixHouse' => $ajk_ppc_info['ajkFixHouse'], 'ajkBidHouseNum' => $ajk_ppc_info['ajkBidHouseNum'], 'ajkNotFixHouseNum' => $ajk_ppc_info['ajkNotFixHouseNum'], 'haveAjk' => intval($ajk_ppc_info['ajkNotFixHouseNum']) + intval($ajk_ppc_info['ajkFixHouse'][0]['fixNum']) > 0 ? 1 : 0);
     $hz_dic_info = array('hzClick' => $hz_ppc_info['hzClick'], 'hzConsume' => $hz_ppc_info['hzConsume'], 'hzFixHouse' => $hz_ppc_info['hzFixHouse'], 'hzBidHouseNum' => $hz_ppc_info['hzBidHouseNum'], 'hzNotFixHouseNum' => $hz_ppc_info['hzNotFixHouseNum'], 'haveHz' => intval($hz_ppc_info['hzNotFixHouseNum']) + intval($hz_ppc_info['hzFixHouse'][0]['fixNum']) > 0 ? 1 : 0);
     if ($choiceCityFlag) {
         $ajk_dic_info['ajkBidHouseNum'] = 0;
         $hz_dic_info['hzBidHouseNum'] = 0;
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('ajkDataDic' => $ajk_dic_info, 'hzDataDic' => $hz_dic_info, 'brokerName' => $brokerBaseInfo['brokerName'], 'phone' => $brokerBaseInfo['phone'], 'chatId' => $chatId, 'twoCodeIcon' => $twoCodeIcon, 'tokenChat' => $token3rd));
 }
Example #27
0
 public static function dfs_pic_display_by_host($uri, $hostid)
 {
     $apf = APF::get_instance();
     $hostsuffix = @$apf->get_config("dfs_pic_display_host_suffix", "resource");
     $schema = $apf->get_request() && $apf->get_request()->is_secure() ? "https" : "http";
     return "{$schema}://pic{$hostid}.{$hostsuffix}{$uri}";
 }
Example #28
0
 public function handle_request_internal()
 {
     $operator = -1;
     $old_isopen = $this->getParameter('isopen');
     $new_isopen = Bll_Broker_ShopSwitcherBll::getShopSwitcherByBrokerId(self::$intBrokerID);
     $this->setAttribute('brokerId', static::$intBrokerID);
     $verifyCode = $this->getParameter('verify_code');
     $request = APf::get_instance()->get_request();
     $cookie = $request->get_cookie('sv');
     $response = APF::get_instance()->get_response();
     $response->remove_cookie('sv');
     $this->setAttribute('clientIp', $request->get_client_ip());
     if ($request->is_post_method() && !empty($cookie) && !Bll_Security_Verify::checkVerifyCode($cookie, $verifyCode)) {
         $this->setAttribute('verifyCodeError', '验证码错误');
         $old_isopen = '';
     }
     if (isset($old_isopen) && in_array($old_isopen, array(0, 1)) && $old_isopen != '') {
         if ($new_isopen == $old_isopen) {
             $operator = -1;
         } else {
             $operator = Bll_Broker_ShopSwitcherBll::updateShopSwitcherByBrokerId(self::$intBrokerID, $old_isopen);
             if ($operator) {
                 $new_isopen = $old_isopen;
             }
         }
     }
     $this->setAttribute('operator', $operator);
     $this->setAttribute('isopen', $new_isopen);
     return 'Broker_ShopSwitcher';
 }
Example #29
0
 public static function is_auth($cookie)
 {
     $request = APF::get_instance()->get_request();
     if ($cookie) {
         $is_flash = @$request->get_parameter("is_flash");
         if ($is_flash) {
             $browser = $request->get_parameter("user_agent");
         } else {
             $browser = $_SERVER['HTTP_USER_AGENT'];
         }
         $iBugsecques = APF::get_instance()->get_config('iBugSecques');
         $cookieStr = Util_AuthorCrypt::decrypt($cookie, md5($browser . $iBugsecques));
         if (empty($cookieStr)) {
             return false;
         }
         $cookieArr = explode("\t", $cookieStr);
         @(list($user_id, $username, $cookietime) = $cookieArr);
         if (empty($user_id) || empty($username)) {
             return false;
         }
         $request->set_user_id($user_id);
         $request->set_username($username);
         return true;
     } else {
         return false;
     }
 }
Example #30
0
 public function handle_request_internal()
 {
     $request = APF::get_instance()->get_request();
     $managerCookie = $request->get_cookie('manager_id');
     if (!empty($managerCookie)) {
         echo json_encode(array('status' => 'error', 'data' => '没有操作权限。'));
         return;
     }
     $houseIds = $request->get_parameter('houseIds');
     $planId = $request->get_parameter('planId');
     if (is_null($houseIds)) {
         echo json_encode(array('status' => 'error', 'data' => '请输入房源ID'));
         return;
     }
     $houseIds = explode(',', $houseIds);
     $houseBaseInfoList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx(static::$intBrokerID, $houseIds, static::$intBrokerCityID, array('proId'));
     if (empty($houseBaseInfoList)) {
         echo json_encode(array('status' => 'error', 'data' => '获取房源信息失败'));
         return;
     }
     $houseIdList = array();
     foreach ($houseBaseInfoList as $houseBaseInfo) {
         $houseIdList[] = $houseBaseInfo['proId'];
     }
     $result = Bll_Ppc_ServiceAPI::fixPlanAddHouse(static::$intBrokerID, $houseIdList, $planId, 21181);
     if ($result && strcasecmp('ok', $result['status']) == 0) {
         echo json_encode(array('status' => 'ok', 'data' => '推广成功'));
     } elseif ($result && strcasecmp('error', $result['status']) == 0) {
         echo json_encode(array('status' => 'error', 'data' => $result['info']));
     } else {
         echo json_encode(array('status' => 'ok', 'data' => '推广成功', 'msg' => '调用API超时'));
     }
 }