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


PHP Base_Common::checkAdult方法代码示例

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


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

示例1: getUserCommunicationAction

 /**
  *获取用户联系信息
  */
 public function getUserCommunicationAction()
 {
     //基础元素,必须参与验证
     $User['UserId'] = $this->request->UserId;
     $User['PartnerId'] = abs(intval($this->request->PartnerId)) ? abs(intval($this->request->PartnerId)) : 1;
     $User['Time'] = abs(intval($this->request->Time));
     $User['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     //URL验证码
     $sign = $this->request->sign;
     //私钥,以后要移开到数据库存储
     $p_sign = 'lm';
     $sign_to_check = base_common::check_sign($User, $p_sign);
     //验证URL是否来自可信的发信方
     if ($sign_to_check == $sign) {
         if ($User['UserId']) {
             //验证时间戳,时差超过600秒即认为非法
             if (abs($User['Time'] - time()) <= 600) {
                 //查询用户
                 $UserInfo = $this->oUser->GetUserById($User['UserId']);
                 if ($UserInfo['UserId']) {
                     //获取用户联系信息
                     $UserCommunicationInfo = $this->oUser->GetUserCommunication($User['UserId']);
                     //格式化用户信息
                     $UserCommunicationInfo = array('UserId' => $User['UserId'], 'UserMail' => $UserCommunicationInfo['UserMail'] ? $UserCommunicationInfo['UserMail'] : "", 'UserCountry' => abs(intval($UserCommunicationInfo['UserCountry'])) ? abs(intval($UserCommunicationInfo['UserCountry'])) : 86, 'UserCity' => abs(intval($UserCommunicationInfo['UserCity'])) ? abs(intval($UserCommunicationInfo['UserCity'])) : 21, 'UserZipCode' => $UserCommunicationInfo['UserZipCode'] ? $UserCommunicationInfo['UserZipCode'] : "", 'UserAddress' => $UserCommunicationInfo['UserAddress'] ? $UserCommunicationInfo['UserAddress'] : "", 'UserMobile' => $UserCommunicationInfo['UserMobile'] ? $UserCommunicationInfo['UserMobile'] : "", 'UserTel' => $UserCommunicationInfo['UserTel'] ? $UserCommunicationInfo['UserTel'] : "", 'UserIdCard' => $UserCommunicationInfo['UserIdCard'] ? $UserCommunicationInfo['UserIdCard'] : "", 'UserSex' => intval($UserCommunicationInfo['UserSex']) ? intval($UserCommunicationInfo['UserSex']) : 0, 'UserRealName' => $UserCommunicationInfo['UserRealName'] ? $UserCommunicationInfo['UserRealName'] : "", 'UserBirthDay' => $UserCommunicationInfo['UserBirthDay'] ? $UserCommunicationInfo['UserBirthDay'] : '1970-01-01', 'UserQQ' => $UserCommunicationInfo['UserQQ'] ? $UserCommunicationInfo['UserQQ'] : "", 'UserMsn' => $UserCommunicationInfo['UserMsn'] ? $UserCommunicationInfo['UserMsn'] : "", 'UserWeibo' => $UserCommunicationInfo['UserWeibo'] ? $UserCommunicationInfo['UserWeibo'] : "", 'UserWeixin' => $UserCommunicationInfo['UserWeixin'] ? $UserCommunicationInfo['UserWeixin'] : "", 'UserNickName' => $UserCommunicationInfo['UserNickName'] ? $UserCommunicationInfo['UserNickName'] : "", 'adult' => $UserCommunicationInfo['UserBirthDay'] ? Base_Common::checkAdult($UserCommunicationInfo['UserBirthDay']) : Base_Common::checkAdult('1970-01-01'));
                     $result = array('return' => 1, 'UserCommunicationInfo' => $UserCommunicationInfo, 'comment' => "");
                 } else {
                     //用户不存在
                     $result = array('return' => 0, 'comment' => "无此用户");
                 }
             } else {
                 $result = array('return' => 0, 'comment' => "时间有误");
             }
         } else {
             $result = array('return' => 0, 'comment' => "请输入用户ID");
         }
     } else {
         $result = array('return' => 0, 'comment' => "验证失败,请检查URL");
     }
     $User['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     if ($User['ReturnType'] == 1) {
         echo json_encode($result);
     }
 }
开发者ID:032404cxd,项目名称:prototype_main,代码行数:46,代码来源:UserController.php


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