当前位置: 首页>>代码示例>>PHP>>正文


PHP Base_Common类代码示例

本文整理汇总了PHP中Base_Common的典型用法代码示例。如果您正苦于以下问题:PHP Base_Common类的具体用法?PHP Base_Common怎么用?PHP Base_Common使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Base_Common类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * 环境初始化
  * @param array $config
  * @return void
  */
 public static function init(array $config = null)
 {
     if (is_array($config)) {
         self::$config = array_merge(self::$config, $config);
     }
     /**
      * 设置自动载入函数
      */
     if (self::$config['autoload']) {
         if (function_exists('__autoload')) {
             spl_autoload_register('__autoload');
         }
         spl_autoload_register(array('Base_Common', 'autoload'));
     }
     /**
      * GPC
      */
     if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
         $_GET = self::stripslashesRecursive($_GET);
         $_POST = self::stripslashesRecursive($_POST);
         $_COOKIE = self::stripslashesRecursive($_COOKIE);
         reset($_GET);
         reset($_POST);
         reset($_COOKIE);
     }
     /**
      * 设置异常抛出
      */
     set_exception_handler(array('Base_Common', 'exceptionHandle'));
     /**
      * 设置时区
      */
     date_default_timezone_set(self::$config['timezone']);
 }
开发者ID:032404cxd,项目名称:xrace_main,代码行数:39,代码来源:Common.php

示例2: indexAction

 public function indexAction()
 {
     //检查权限
     $PermissionCheck = $this->manager->checkMenuPermission(0);
     if ($PermissionCheck['return']) {
         $SexList = $this->oUser->getSexList();
         $AuthStatusList = $this->oUser->getAuthStatus();
         $AuthIdTypesList = $this->oUser->getAuthIdType();
         $params['Sex'] = isset($SexList[strtoupper(trim($this->request->Sex))]) ? substr(strtoupper(trim($this->request->Sex)), 0, 8) : "";
         $params['Name'] = urldecode(trim($this->request->Name)) ? substr(urldecode(trim($this->request->Name)), 0, 8) : "";
         $params['NickName'] = urldecode(trim($this->request->NickName)) ? substr(urldecode(trim($this->request->NickName)), 0, 8) : "";
         $params['AuthStatus'] = isset($AuthStatusList[strtoupper(trim($this->request->AuthStatus))]) ? substr(strtoupper(trim($this->request->AuthStatus)), 0, 8) : "";
         $params['Page'] = abs(intval($this->request->Page)) ? abs(intval($this->request->Page)) : 1;
         $params['PageSize'] = 5;
         $params['getCount'] = 1;
         $UserList = $this->oUser->getUserLst($params);
         //导出EXCEL链接
         $export_var = "<a href =" . Base_Common::getUrl('', 'xrace/user', 'user.list.download', $params) . "><导出表格></a>";
         //翻页参数
         $page_url = Base_Common::getUrl('', 'xrace/user', 'index', $params) . "&Page=~page~";
         $page_content = base_common::multi($UserList['UserCount'], $page_url, $params['Page'], $params['PageSize'], 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页');
         foreach ($UserList['UserList'] as $UserId => $UserInfo) {
             echo $UserInfo['auth_state'] . "<br>";
             $UserList['UserList'][$UserId]['sex'] = isset($SexList[$UserInfo['sex']]) ? $SexList[$UserInfo['sex']] : "保密";
             $UserList['UserList'][$UserId]['AuthStatus'] = isset($AuthStatusList[$UserInfo['auth_state']]) ? $AuthStatusList[$UserInfo['auth_state']] : "未知";
             $UserList['UserList'][$UserId]['AuthStatus'] = $UserInfo['auth_state'] == "AUTHED" && isset($AuthIdTypesList[strtoupper(trim($UserInfo['id_type']))]) ? $UserList['UserList'][$UserId]['AuthStatus'] . "/" . $AuthIdTypesList[strtoupper(trim($UserInfo['id_type']))] : $UserList['UserList'][$UserId]['AuthStatus'];
             $UserList['UserList'][$UserId]['Birthday'] = is_null($UserInfo['birth_day']) ? "未知" : $UserInfo['birth_day'];
         }
         include $this->tpl('Xrace_User_UserList');
     } else {
         $home = $this->sign;
         include $this->tpl('403');
     }
 }
开发者ID:eappl,项目名称:admin_prototype,代码行数:34,代码来源:UserController.php

示例3: pageViewAction

 /**
  *问题浏览量更新
  */
 public function pageViewAction()
 {
     //基础元素,必须参与验证
     $View['PageId'] = abs(intval($this->request->PageId));
     $View['ViewIP'] = urldecode(trim($this->request->ViewIP));
     $View['Time'] = abs(intval($this->request->Time));
     //URL验证码
     $sign = $this->request->sign;
     //私钥,以后要移开到数据库存储
     $p_sign = '5173';
     $sign_to_check = base_common::check_sign($View, $p_sign);
     //不参与验证的元素
     //验证URL是否来自可信的发信方
     if ($sign_to_check == $sign) {
         //验证时间戳,时差超过600秒即认为非法
         if (abs($View['Time'] - time()) <= 600) {
             $View['ViewIP'] = Base_Common::ip2long($View['ViewIP']);
             $InsertLog = $this->oView->addViewLog($View);
             if ($InsertLog) {
                 $result = array('return' => 1, 'comment' => "添加成功");
             } else {
                 $result = array('return' => 2, 'comment' => "添加失败");
             }
         } else {
             $result = array('return' => 0, 'comment' => "时间有误");
         }
     } else {
         $result = array('return' => 0, 'comment' => "验证失败,请检查URL");
     }
     echo json_encode($result);
 }
开发者ID:eappl,项目名称:prototype,代码行数:34,代码来源:ViewController.php

示例4: insert

 public function insert()
 {
     $result = Base_Common::pputHttpSQS($this->getDbTable(), $this->logArr);
     if (!$result) {
         $fp = fopen(Base_Common::$config['vars_dir'] . 'error.log', 'a+');
         fwrite($fp, var_export($this->logArr, true));
         fclose($fp);
     }
 }
开发者ID:eappl,项目名称:prototype,代码行数:9,代码来源:Web.php

示例5: insertPvAction

 /**
  *账号生成
  */
 public function insertPvAction()
 {
     //基础元素,必须参与验证
     $PV['PageId'] = abs(intval($this->request->PageId));
     $PV['Time'] = abs(intval($this->request->Time));
     $PV['IP'] = $this->request->IP ? $this->request->IP : "127.0.0.1";
     $PV['Browser'] = $this->request->Browser;
     $PV['UserSourceId'] = abs(intval($this->request->UserSourceId));
     $PV['UserSourceDetail'] = abs(intval($this->request->UserSourceDetail));
     $PV['UserSourceProjectId'] = abs(intval($this->request->UserSourceProjectId));
     $PV['UserSourceActionId'] = abs(intval($this->request->UserSourceActionId));
     $PV['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     //URL验证码
     $sign = $this->request->sign;
     //私钥,以后要移开到数据库存储
     $p_sign = 'lm';
     $sign_to_check = base_common::check_sign($PV, $p_sign);
     //不参与验证的元素
     $PV['IP'] = Base_Common::ip2long($PV['IP']);
     //验证URL是否来自可信的发信方
     if ($sign_to_check == $sign) {
         //验证时间戳,时差超过600秒即认为非法
         if (abs($PV['Time'] - time()) <= 600) {
             unset($PV['ReturnType']);
             if ($PV['UserSourceId'] == 9 && $PV['UserSourceDetail'] == 24) {
                 $insertLog = true;
             } else {
                 $insertLog = $this->oPV->insertPvLog($PV);
             }
             if ($insertLog) {
                 $result = array('return' => 1, 'comment' => "记录成功");
             } else {
                 $result = array('return' => 0, 'comment' => "记录失败");
             }
         } else {
             $result = array('return' => 2, 'comment' => "时间有误");
         }
     } else {
         $result = array('return' => 2, 'comment' => "验证失败,请检查URL");
     }
     $PV['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     if ($PV['ReturnType'] == 1) {
         echo json_encode($result);
     }
 }
开发者ID:eappl,项目名称:prototype,代码行数:48,代码来源:PvController.php

示例6: remove

 /**
  * 移除cookie
  * @param string $key
  * @param string $url
  * @return void
  */
 public static function remove($key, $url = null)
 {
     if (!isset($_COOKIE[$key])) {
         return;
     }
     $path = '/';
     if (!empty($url)) {
         $parsed = parse_url($url);
         $path = empty($parsed['path']) ? '/' : Base_Common::url(null, $parsed['path']);
     }
     if (is_array($_COOKIE[$key])) {
         foreach ($_COOKIE[$key] as $name => $val) {
             setcookie("{$key}[{$name}]", '', time() - 2592000, $path);
         }
     } else {
         setcookie($key, '', time() - 2592000, $path);
     }
 }
开发者ID:eappl,项目名称:prototype,代码行数:24,代码来源:Cookie.php

示例7: getServerByIpAction

 /**
  *获取服务器列表登录
  */
 public function getServerByIpAction()
 {
     //基础元素,必须参与验证
     $Config['ServerIp'] = $this->request->ServerIp;
     $Config['Time'] = abs(intval($this->request->Time));
     $Config['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     //URL验证码
     $sign = trim($this->request->sign);
     //私钥,以后要移开到数据库存储
     $p_sign = 'lm';
     $sign_to_check = Base_common::check_sign($Config, $p_sign);
     //不参与验证的元素
     //验证URL是否来自可信的发信方
     if ($sign_to_check == $sign) {
         //验证时间戳,时差超过600秒即认为非法
         if (abs($Config['Time'] - time()) <= 600) {
             if ($Config['ServerIp']) {
                 $ServerIp = Base_Common::ip2long($Config['ServerIp']);
                 $ServerInfo = $this->oServer->getByIp($ServerIp);
                 if ($ServerInfo['ServerId']) {
                     $result = array('return' => 1, 'ServerInfo' => $ServerInfo, 'comment' => '找到服务器');
                 } else {
                     $result = array('return' => 2, 'comment' => '你所查询的IP不属于任何服务器');
                 }
             } else {
                 $result = array('return' => 0, 'comment' => "请输入服务器IP");
             }
         } else {
             $result = array('return' => 0, 'comment' => "时间有误");
         }
     } else {
         $result = array('return' => 0, 'comment' => "验证失败,请检查URL");
     }
     if ($Config['ReturnType'] == 1) {
         echo json_encode($result);
     } else {
         $r = $result['return'] . "|" . iconv('UTF-8', 'GBK', $result['comment']);
         if ($result['return'] == 1) {
             $r = $r . "|" . $result['ServerInfo']['ServerId'] . "|" . iconv('UTF-8', 'GBK', $result['ServerInfo']['name']);
         }
         echo $r;
     }
 }
开发者ID:032404cxd,项目名称:prototype_main,代码行数:46,代码来源:ServerController.php

示例8: addSystemLog

 public function addSystemLog($QuestionId, $AuthorName, $OperatorName, $LogTypeId, $LogText)
 {
     $LogType = $this->config->sys_log_arr;
     $LogTypeId = intval($LogTypeId);
     if (isset($LogType[$LogTypeId])) {
         $tip = $LogType[$LogTypeId];
     } else {
         return false;
     }
     $QuestionId = intval($QuestionId);
     //if($QuestionId == 0)
     //{
     //	return false;
     //}
     $log_id = Base_Common::get_log_sn();
     $message = $tip . $LogText;
     $time = time();
     $date = date("Ym", $time);
     $table_to_process = Base_Widget::getDbTable($this->table) . "_" . $date;
     $dataArr = array('id' => $log_id, 'AuthorName' => $AuthorName, 'qid' => $QuestionId, 'user' => $OperatorName, 'message' => $message, 'time' => $time);
     return $this->db->insert($table_to_process, $dataArr);
 }
开发者ID:eappl,项目名称:prototype,代码行数:22,代码来源:Common.php

示例9: authLogAction

 public function authLogAction()
 {
     //检查权限
     $PermissionCheck = $this->manager->checkMenuPermission(0);
     if ($PermissionCheck['return']) {
         //页面参数预处理
         $params['StartDate'] = isset($this->request->StartDate) ? substr(strtoupper(trim($this->request->StartDate)), 0, 10) : date("Y-m-d", time());
         $params['EndDate'] = isset($this->request->EndDate) ? substr(strtoupper(trim($this->request->EndDate)), 0, 10) : date("Y-m-d", time());
         $params['AuthResult'] = isset($this->request->AuthResult) ? substr(strtoupper(trim($this->request->AuthResult)), 0, 8) : "";
         $params['ManagerId'] = isset($this->request->ManagerId) ? intval($this->request->ManagerId) : 0;
         //分页参数
         $params['Page'] = abs(intval($this->request->Page)) ? abs(intval($this->request->Page)) : 1;
         $params['PageSize'] = 2;
         //获取用户列表时需要获得记录总数
         $params['getCount'] = 1;
         //获取实名认证记录的状态列表
         $AuthLogIdStatusList = $this->oUser->getAuthLogStatusTypeList();
         //获取所有管理员列表
         $ManagerList = $this->manager->getAll('id,name');
         //获取实名认证记录
         $AuthLog = $this->oUser->getAuthLog($params);
         //导出EXCEL链接
         $export_var = "<a href =" . Base_Common::getUrl('', 'xrace/user', 'auth.log.download', $params) . "><导出表格></a>";
         //翻页参数
         $page_url = Base_Common::getUrl('', 'xrace/user', 'auth.log', $params) . "&Page=~page~";
         $page_content = base_common::multi($AuthLog['AuthLogCount'], $page_url, $params['Page'], $params['PageSize'], 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页');
         //初始化一个空的用户数组
         $UserList = array();
         foreach ($AuthLog['AuthLog'] as $AuthId => $LogInfo) {
             //管理员账号
             $AuthLog['AuthLog'][$AuthId]['ManagerName'] = isset($ManagerList[$LogInfo['op_uid']]) ? $ManagerList[$LogInfo['op_uid']]['name'] : "未知";
             $AuthLog['AuthLog'][$AuthId]['AuthResultName'] = isset($AuthLogIdStatusList[$LogInfo['auth_result']]) ? $AuthLogIdStatusList[$LogInfo['auth_result']] : "未知";
             // 如果管理员记录已经获取到
             if (isset($UserList[$LogInfo['user_id']])) {
                 $ManagerInfo = $UserList[$LogInfo['user_id']];
             } else {
                 $ManagerInfo = $this->oUser->getUserInfo($LogInfo['user_id'], "name");
             }
             $AuthLog['AuthLog'][$AuthId]['UserName'] = $ManagerInfo['name'];
             //实名认证提交的照片
             $AuthLog['AuthLog'][$AuthId]['submit_img1'] = isset($AuthLog['AuthLog'][$AuthId]['submit_img1']) ? urldecode($AuthLog['AuthLog'][$AuthId]['submit_img1']) : "";
             $AuthLog['AuthLog'][$AuthId]['submit_img2'] = isset($AuthLog['AuthLog'][$AuthId]['submit_img2']) ? urldecode($AuthLog['AuthLog'][$AuthId]['submit_img2']) : "";
         }
         //模板渲染
         include $this->tpl('Xrace_User_AuthLog');
     } else {
         $home = $this->sign;
         include $this->tpl('403');
     }
 }
开发者ID:032404cxd,项目名称:xrace_main,代码行数:50,代码来源:UserController.php

示例10: getItemPickUpCount

 public function getItemPickUpCount($StartTime, $EndTime, $UserId, $ServerId, $oWherePartnerPermission, $ItemListText)
 {
     //查询列
     $select_fields = array('PickUpCount' => 'count(*)');
     //初始化查询条件
     $whereStartTime = $StartTime ? " ItemPickUpTime >= '" . strtotime($StartTime) . "' " : "";
     $whereEndTime = $EndTime ? " ItemPickUpTime <= '" . strtotime($EndTime) . "' " : "";
     $whereServer = $ServerId ? " ServerId = " . $ServerId . " " : "";
     $whereItemID = $ItemListText ? " ItemID in ( " . $ItemListText . " )" : "";
     $whereUser = $UserId ? " UserId = " . $UserId . " " : "";
     $whereCondition = array($whereStartTime, $whereEndTime, $whereUser, $whereServer, $oWherePartnerPermission, $whereItemID);
     //生成查询列
     $fields = Base_common::getSqlFields($select_fields);
     //生成条件列
     $where = Base_common::getSqlWhere($whereCondition);
     if ($UserId) {
         $position = Base_Common::getUserDataPositionById($UserId);
         $table_to_process = Base_Common::getUserTable($this->table_list['pickitem_user'], $position);
     } else {
         $Date = date("Ymd", strtotime($StartTime));
         $table_to_process = Base_Widget::getDbTable($this->table_list['pickitem']) . "_" . $Date;
     }
     $sql = "SELECT {$fields} FROM {$table_to_process} as log where 1 " . $where;
     $PickUpCount = $this->db->getOne($sql, false);
     if ($PickUpCount) {
         return $PickUpCount;
     } else {
         return 0;
     }
 }
开发者ID:eappl,项目名称:prototype,代码行数:30,代码来源:Item.php

示例11: UserLoginSumDate

 public function UserLoginSumDate($UserId, $oWherePartnerPermission)
 {
     //初始化查询条件
     $whereCondition = array($oWherePartnerPermission);
     $where = Base_common::getSqlWhere($whereCondition);
     $position = Base_Common::getUserDataPositionById($UserId);
     $table_to_process = Base_Widget::getDbTable($this->table_user) . "_" . $position['db_fix'];
     $sql = "SELECT sum(`LogoutTime`-`LoginTime`) as `LoingTime` FROM {$table_to_process} WHERE `UserId` = {$UserId} and `LogoutTime` > 0 and `LogoutTime` > `LoginTime` " . $where;
     return $this->db->getOne($sql, false);
 }
开发者ID:eappl,项目名称:prototype,代码行数:10,代码来源:Login.php

示例12: upload

 public function upload($path)
 {
     $this->savePath = $path;
     if (!is_dir($this->fileDir . $this->savePath) && !mkdir($this->fileDir . $this->savePath)) {
         throw new Base_Exception(sprintf('目录 %s 不存在', $this->fileDir . $this->savePath), 403);
     }
     @chmod($this->fileDir . $this->savePath);
     if (!is_writeable($this->fileDir . $this->savePath)) {
         throw new Base_Exception(sprintf('目录 %s 不可写', $this->fileDir . $this->savePath), 403);
     }
     foreach ($this->fileArr as $k => $file) {
         if (!self::isUploadedFile($file['tmp_name'])) {
             $this->resultArr[$k]['errno'] = 1;
             $this->resultArr[$k]['description'] = '文件上传失败';
             continue;
         }
         $suffix = Base_Common::fileSuffix($file['name']);
         $isImage = in_array($suffix, $this->allowImageExtArr);
         //			if ($this->onlyAllowImage && !$isImage) {
         //				$this->resultArr[$k]['errno'] = 2;
         //				$this->resultArr[$k]['description'] = '不允许上传非图片类型文件';
         //				continue;
         //			}
         if (!in_array($suffix, $this->allowFileExtArr)) {
             $this->resultArr[$k]['errno'] = 3;
             $this->resultArr[$k]['description'] = '类型文件不允许';
             continue;
         }
         if ($file['size'] > $this->maxFileSize) {
             $this->resultArr[$k]['errno'] = 4;
             $this->resultArr[$k]['description'] = '文件大小超过限制';
             continue;
         }
         $filename = $file['name'];
         $target = $this->fileDir . $this->savePath . '/' . $filename;
         $target_root = $this->fileUrl . "/" . $this->savePath . '/' . $filename;
         if (move_uploaded_file($file['tmp_name'], $target) || @copy($file['tmp_name'], $target)) {
             $this->resultArr[$k]['errno'] = 0;
             $this->resultArr[$k]['description'] = '文件上传成功';
             $this->resultArr[$k]['path'] = $target;
             $this->resultArr[$k]['path_root'] = $target_root;
             $this->uploadedFileArr[] = array('name' => $file['name'], 'url' => $this->savePath . $filename, 'type' => $file['type'], 'size' => $file['size'], 'description' => $file['description'], 'is_image' => $isImage);
         } else {
             $this->resultArr[$k]['errno'] = 5;
             $this->resultArr[$k]['description'] = '文件上传失败';
         }
     }
     return $this;
 }
开发者ID:032404cxd,项目名称:xrace_main,代码行数:49,代码来源:Upload.php

示例13: detailAction

 public function detailAction()
 {
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
     $SourceProjectId = intval($this->request->SourceProjectId);
     $SourceProject = $this->oSourceProject->getRow($SourceProjectId, '*');
     $SourceProjectDetail = $this->oSourceProject->getDetail($SourceProjectId);
     $SourceList = $this->oSource->getAll();
     $SourceDetailList = $this->oSourceDetail->getAll(0);
     //下载参数
     $export = $this->request->export ? intval($this->request->export) : 0;
     $links = 'http://passport.wjyx.com/?c=media&PageId=2';
     foreach ($SourceProjectDetail as $key => $value) {
         $SourceProjectDetail[$key]['SourceName'] = $SourceList[$value['SourceId']]['name'];
         $SourceProjectDetail[$key]['SourceDetailName'] = $value['SourceDetail'] ? $SourceDetailList[$value['SourceDetail']]['name'] : "<font color = 'red'>全部</font>";
         $SourceProjectDetail[$key]['SourceUrl'] = $links . "&UserSourceId=" . $value['SourceId'] . "&UserSourceDetail=" . $value['SourceDetail'] . "&UserSourceProjectId=" . $value['SourceProjectId'];
         //$SourceProjectDetail[$key]['SourceUrl'] = "&UserSourceId=".$value['SourceId']."UserSourceDetail".$value['SourceDetail']."UserSourceProjectId".$value['SourceProjectId'];
         //			$SourceProjectDetail[$key]['SourceUrl'] = Base_Common::my_authcode($SourceProjectDetail[$key]['SourceUrl'],'','limaogame');
     }
     $param['SourceProjectId'] = $SourceProjectId;
     $execlParam = $param + array("export" => 1);
     $export_var = "<a href =" . Base_Common::getUrl('', 'config/source/project', 'detail', $execlParam) . "><导出表格></a>";
     if ($export == 1) {
         $oExcel = new Third_Excel();
         $FileName = '广告位列表--' . $SourceProject['name'];
         //标题栏
         $title = array("广告商", "广告位", "连接参数");
         $oExcel->download($FileName)->addSheet('广告位列表');
         $oExcel->addRows(array($title));
         foreach ($SourceProjectDetail as $key => $sourceproject_detail) {
             //生成单行数据
             $t['SourceName'] = $sourceproject_detail['SourceName'];
             $t['SourceDetailName'] = $sourceproject_detail['SourceDetailName'];
             $t['SourceUrl'] = $sourceproject_detail['SourceUrl'];
             $oExcel->addRows(array($t));
             unset($t);
         }
         //结束excel
         $oExcel->closeSheet()->close();
     }
     include $this->tpl('Config_Source_Project_Detail_list');
 }
开发者ID:eappl,项目名称:prototype,代码行数:42,代码来源:ProjectController.php

示例14: getPvpLogTotal

 public function getPvpLogTotal($whereTime)
 {
     $table_to_process = Base_Widget::getDbTable($this->table_pvp_log_total);
     $sql = "truncate {$table_to_process}";
     $this->db->query($sql);
     for ($i = 0; $i <= 255; $i++) {
         $position = Base_Common::getUserDataPositionById(sprintf("%03d", $i));
         $table_to_get = Base_Common::getUserTable($this->table_pvp_log_user, $position);
         $sql = "replace into {$table_to_process} (ServerId,UserId,Won,PvpCount) select ServerId,UserId,Won,Count(*) from {$table_to_get} where {$whereTime} group by ServerId,UserId,Won";
         echo $this->db->query($sql) . "-";
     }
 }
开发者ID:eappl,项目名称:prototype,代码行数:12,代码来源:Task.php

示例15: getOperatorFromVadmin

 function getOperatorFromVadmin($OperatorName, $Detail = "")
 {
     Base_Common::getLocalIP();
     $array = array('CurrentIp' => $IP, 'OpLoginId' => $OperatorName);
     $Data = json_encode($array);
     $key = "987654321!@#\$%";
     $txt = "6" . $Data . $key;
     $sign = md5(strtoupper($txt));
     $Data = urlencode(base64_encode($Data));
     $url = "http://tradeservice.5173esb.com/CommService/CommonRequest.ashx?OperationType=6&Data={$Data}&Sign={$sign}";
     $return = file_get_contents($url);
     $return_arr = json_decode(base64_decode($return), true);
     if (is_array($return_arr)) {
         $OperatorInfo = json_decode($return_arr['JsonData'], true);
         if ($OperatorInfo['OpLoginId'] != "") {
             $Operator = array('photo' => $OperatorInfo['OpAvatar'], 'QQ' => $OperatorInfo['OPQQ'], 'mobile' => $OperatorInfo['OPMObile'], 'tel' => $OperatorInfo['OPTel'], 'weixin' => $OperatorInfo['OPWeiXin'], 'name' => $OperatorInfo['OPName'], 'cno' => $OperatorInfo['OpRealName'], 'login_name' => $OperatorInfo['OpLoginId'], 'weixinPicUrl' => $OperatorInfo['OPWeiXinPicUrl'], 'weixinPicUrl_officer' => $OperatorInfo['OPWeiXinPicUrl2'], 'xnGroupId' => $OperatorInfo['OPSmallCanUID'], 'xnGroupId_officer' => $OperatorInfo['OPSmallCanUID2'], 'photo_officer' => $OperatorInfo['OpAvatar2'], 'qq_url' => $OperatorInfo['OPQQIdKey'] == "" ? "" : 'http://sighttp.qq.com/authd?IDKEY=' . $OperatorInfo['OPQQIdKey'], 'qq_url_officer' => $OperatorInfo['OPQQIdKey2'] == "" ? "" : 'http://sighttp.qq.com/authd?IDKEY=' . $OperatorInfo['OPQQIdKey2'], 'QQ_officer' => $OperatorInfo['OPQQ2'], 'mobile_officer' => $OperatorInfo['OPMObile2'], 'tel_officer' => $OperatorInfo['OPTel2'], 'weixin_officer' => $OperatorInfo['OPWeiXin2'], 'name_officer' => $OperatorInfo['OPName2'], 'cno_officer' => $OperatorInfo['OpRealName2'], 'login_name_officer' => $OperatorInfo['OpLoginId2'], 'qq_link_type' => $OperatorInfo['IsNewPopQQ'] == 0 ? 'js' : 'http');
             //去除所需列表之外的数据
             $t = explode(",", $Detail);
             if (count($t) > 1) {
                 foreach ($Operator as $key => $value) {
                     if (!in_array($key, $t)) {
                         unset($Operator[$key]);
                     }
                 }
             }
             return $Operator;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:032404cxd,项目名称:prototype_main,代码行数:33,代码来源:Operator.php


注:本文中的Base_Common类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。