chengkun
2025-05-30 abb66a0e799e7ca613e8967a304e7c5ed00e034e
app/model/userinfo.model.php
@@ -1,9 +1,7 @@
<?php
class userinfo_model extends model
{
class userinfo_model extends model {
    private $comstatusStr =array(
       0   =>   ' 被设为未审核状态',
@@ -13,8 +11,7 @@
       4   =>   ' 被暂停'
    );
    private function addErrorLog($uid,$type='',$content)
    {
    private function addErrorLog($uid, $type = '', $content) {
        
        require_once ('errlog.model.php');
        $ErrlogM = new errlog_model($this->db, $this->def);
@@ -22,8 +19,7 @@
    }
    
   // 获取账户信息
   function getInfo($where,$data=array())
    {
    function getInfo($where, $data = array()) {
       
       $field  =   empty($data['field']) ? '*' : $data['field'];
       
@@ -427,8 +423,7 @@
   }
   
   //修改用户信息
    public function upInfo($whereData = array(), $upData = array(), $data = array())
    {
    public function upInfo($whereData = array(), $upData = array(), $data = array()) {
        if (!empty($whereData)) {
            //处理password
@@ -446,6 +441,7 @@
            return $this->update_once('member', $upData, $whereData);
        }
    }
   /**
    * 用户注册检测,修改基本信息检测
    * @param $data 
@@ -639,8 +635,8 @@
       }
       return $return;
   }
   private function setMemberInfo($uid, $utype, $up, $oldMem)
   {
    private function setMemberInfo($uid, $utype, $up, $oldMem) {
 
       $uData  =  array();
@@ -727,8 +723,7 @@
     * @param array $data
     * @return array|bool|false|string|void
     */
    function getUserInfo($whereData = array(), $data = array('usertype' => null, 'field' => null))
    {
    function getUserInfo($whereData = array(), $data = array('usertype' => null, 'field' => null)) {
        if (!empty($whereData)) {
@@ -738,6 +733,7 @@
            return $this->select_once($table, $whereData, $field);
        }
    }
   /**
    * 根据用户类型,直接批量查找用户信息
    * @param array $whereData
@@ -756,6 +752,7 @@
           return $this -> select_all($table,$whereData,$field);
       }
   }
   /**
    * 根据用户类型,修改用户信息
    */
@@ -767,6 +764,7 @@
           
      return $this->update_once($table,$data['post'],$Where);
    }
   /**
     * 获取不同类型用户姓名、企业名称、头像
     */
@@ -853,6 +851,7 @@
         return $List;
      }
    }
    /**
     * 根据不同类型用户的搜索条件获取uid集合
     * $whereData[1]:resume表查询条件 
@@ -966,6 +965,7 @@
       
       return $return;
   }
   /**
    * 锁定用户(账户锁定和相关用户类型审核是否通过没有关系)
    * @param array $whereData
@@ -1081,8 +1081,7 @@
       return $return;
   }
   private function commonLock($uid, $up, $lock_info = '')
   {
    private function commonLock($uid, $up, $lock_info = '') {
      $where = array('uid' => $uid);
        
        include_once('resume.model.php');
@@ -1117,8 +1116,7 @@
     * @param array $data
     * @return mixed
     */
   public function status($whereData = array('uid'=>null,'usertype'=>null), $data = array('post'=>null))
    {
    public function status($whereData = array('uid' => null, 'usertype' => null), $data = array('post' => null)) {
        if (!empty($whereData)) {
            
            $post      =  $data['post'];
@@ -1241,6 +1239,7 @@
        }
        return $return;
    }
   /**
    * 会员审核发送通知
    * @param $uid   参数格式:uid = array('in', '1,2,3'); uid = 1;
@@ -1332,6 +1331,7 @@
           }
       }
   }
   //后台个人会员列表处理数据
   private function getDataList($List){
       
@@ -1412,6 +1412,7 @@
       return $List;
   }
   /**
    * @desc 生成password(包括原密码验证)
    * 
@@ -1446,13 +1447,13 @@
      
      return $pwdRes;
   }
   /**
    * 删除个人会员
    */
   private function delUser($uid){
       
       if (!empty($uid)){
         
         
         $return   =   $this -> delete_all('resume',array('uid'=>array('in',$uid)),'');
@@ -1778,6 +1779,7 @@
           return $return;
       }
   }
   /**
    * 删除猎头会员
    */
@@ -1870,6 +1872,7 @@
           return $return;
       }
   }
   /**
    * 删除培训会员
    */
@@ -1940,7 +1943,6 @@
      if (!empty($uid)){
         
           $return    =  $this -> delete_all('gq_info',array('uid'=>array('in',$uid)), '');
           
           if ($return){
@@ -1961,6 +1963,7 @@
      }
      return $return;
   }
   /**
    * @desc 修改用户名
    * @param array $data
@@ -2092,6 +2095,7 @@
      return $List;
      
   }
   /**
    * 获取member_reg信息
    * 通用的data数组
@@ -2103,6 +2107,7 @@
      return $nid;
      
   }
   /**
    * 上传个人头像
    */
@@ -2153,6 +2158,7 @@
      }
      
   }
   /**
    * 个人身份认证
    */
@@ -2252,6 +2258,7 @@
         return $return;
      }
   }
       /**
    * 处理单个图片上传
    * @param file/需上传文件; dir/上传目录; type/上传图片类型; base/需上传base64; preview/pc预览即上传
@@ -2287,9 +2294,7 @@
     * @param array $data   $data['uid'] $data['usertype']
     * @return array|int[]|string[]
     */
   public function userLogin($data = array())
    {
    public function userLogin($data = array()) {
      $username    =  $data['username'];
      if(!empty($data['moblie'])){
         $moblie  =  $data['moblie'];
@@ -2319,11 +2324,8 @@
         // 未注册手机登录直接注册新账号
         $member_arr   =   $this->getMemberNum(array('moblie'=>$moblie));
         if(!$member_arr || $member_arr==0){
             $return =   $this -> regUserByMobile($moblie, $data);
            if($return['errcode']!=1){
               return $return;
            }else{
@@ -2340,7 +2342,7 @@
            }
         }
         if(CheckRegUser($username)==false && CheckRegEmail($username)==false && ($username!='')){
            if (!CheckRegUser($username) && !CheckRegEmail($username) && ($username != '')) {
            return array('msg'=>'用户名或密码不正确!','errcode'=>'8');
         }
         
@@ -2373,30 +2375,24 @@
      
      //开启UC情况下 需要判断UC账户 并进行同步登录
      if($this->config['sy_uc_type']=="uc_center"  && !$data['act_login']){
         include APP_PATH.'data/api/uc/config.inc.php';
         include APP_PATH.'/api/uc/include/db_mysql.class.php';
         include APP_PATH.'/api/uc/uc_client/client.php';
         $uname = $username;
         
         list($uid, $uname, $password, $email) = uc_user_login($uname, $data['password']);
      
         if($uid>0){
            //创建登录同步通知
            $ucsynlogin=uc_user_synlogin($uid);
            $return['uclogin']   =   $ucsynlogin;
         }
      }
      //如果系统未找到该用户 转向UC验证 是否UC用户 排除动态码登录
      if(empty($user)){
         //自动将UC账号注册至系统
         if($uid > 0) {
            if($data['source']){
               $source   =   $data['source'];
            }else{
@@ -2423,29 +2419,23 @@
            return array('msg'=>'该用户不存在!','errcode'=>'8');
         }
      }else{
         if($user['status']=='2'){
            return array('msg'=>'您的账号已被锁定!','errcode'=>'8','url'=>Url('register',array('c'=>'ok','type'=>2),'1'));   
         }
         //如果是企业用户,验证企业是否暂停
         if($user['usertype']=='2'){
            $commember  =  $this->select_once('company',array('uid'=>$user['uid']),'r_status');
            if($commember['r_status']==4){
               return array('msg'=>'您的账号已被暂停!','errcode'=>'8');
            }
         }
         if ($this->config['sy_msg_isopen'] && $this->config['sy_msg_login'] && !empty($data['act_login'])) {
            if ($this->config['sy_msg_isopen'] && $this->config['sy_msg_login'] && !empty($data['act_login'])) {
            //短信验证码校验            
            if($regNew == 1){   
               $companywhere['check']   =   $user['moblie'];
            }else{
               $companywhere['uid']   =   $user['uid'];
            }
@@ -2455,11 +2445,12 @@
            include_once ('company.model.php');
            $CompanyM               =      new company_model($this->db, $this->def);   
            $cert_arr               =      $CompanyM->getCertInfo($companywhere);               
            if (is_array($cert_arr)) {
               $checkTime             =       $noticeM->checkTime($cert_arr['ctime']);
               if($checkTime){
                  $res             =       $data['password'] == $cert_arr['check2'] ? true : false;
                  if($res == false){
                        $res = $data['password'] == $cert_arr['check2'];
                        if (!$res) {
                     return array('msg'=>'短信验证码错误!','errcode'=>'8'); 
                  }                  
               }else {      
@@ -2477,7 +2468,6 @@
      }
      if($res){
         //更新用户QQ互联ID               
         if (session_id() == ''){
            session_start();
@@ -2670,11 +2660,8 @@
               $return['user']['spid'] =      1;
            }
         }
         return $return;
      }else{
         return array('msg'=>'用户名或密码不正确!','errcode'=>'8');
            $return = array('msg' => '用户名或密码不正确!', 'errcode' => '8');
      }
      return $return;
   }
@@ -2684,8 +2671,7 @@
     * @param String $moblie 未注册手机号登录,直接注册新会员
     * @return int[]
     */
   private function regUserByMobile($moblie, $data = array())
    {
    private function regUserByMobile($moblie, $data = array()) {
      
      include_once ('company.model.php');
      include_once ('notice.model.php');
@@ -2934,8 +2920,7 @@
     * @param array $data
     * @return int[]
     */
   public function userRegSave($data = array())
    {
    public function userRegSave($data = array()) {
      
      include_once ('notice.model.php');
      $noticeM   =   new notice_model($this->db, $this->def);
@@ -3425,8 +3410,7 @@
     * @param array $data
     * @return mixed
     */
    private function addIdentInfo($uid, $data = array())
    {
    private function addIdentInfo($uid, $data = array()) {
        $usertype   =   $data['reg_type'];
        $user       =   $this->getInfo(array('uid' => intval($uid)), array('field' => '`uid`,`username`,`password`,`salt`,`email`,`moblie`,`moblie_status`,`email_status`,`did`,`login_date`'));
@@ -3614,8 +3598,7 @@
    * @param  array $data
    * @return array $return
    */
   function upUserType($data = array())
    {
    function upUserType($data = array()) {
        $uid        =   intval($data['uid']);
        $usertype   =   intval($data['usertype']);
@@ -3692,8 +3675,7 @@
     * @param $usertype
     * @param array $user
     */
    public function activUser($uid, $usertype, $user = array())
    {
    public function activUser($uid, $usertype, $user = array()) {
        $this->upInfo(array('uid' => intval($uid)), array('usertype' => $usertype));
@@ -4146,11 +4128,11 @@
        }
        return $return;
    }
   /**
    * 小程序和app账号绑定(微信、QQ、新浪微博)
    */
   public function loginBind($data)
   {
    public function loginBind($data) {
      if(!empty($data)){
          
          if (empty($data['openid'])){
@@ -4309,11 +4291,11 @@
         return $return;
      }
   }
   /**
    * 小程序和app第三方登录检测(微信、QQ、新浪微博)
    */
   public function loginCheck($data)
   {
    public function loginCheck($data) {
       
       if ($data['type'] == 'weixin'){
           
@@ -4461,6 +4443,7 @@
      }
      return $return;
   }
   /**
    * 微信小程序通过解密getPhoneNumber接口参数,来获取手机号。 然后检测是否绑定账号,没绑定的,自动注册账号
    */
@@ -4518,6 +4501,7 @@
       }
       return $return;
   }
   //申请切换用户列表
   public function getUserChangeList($where,$data=array()){
      $usertype   =   array('1'=>'个人会员','2'=>'企业会员','3'=>'猎头会员','4'=>'培训会员');
@@ -4547,11 +4531,13 @@
      $return   =   $this   ->   insert_into('user_change',$addData);
      return   $return;
   }
   public function upusChange($whereData=array(),$upData=array()){
      $return   =   $this   ->   update_once('user_change',$upData,$whereData);
      return   $return;
   }
   // 获取账户信息
   function getUserChangeInfo($where,$data=array()){
@@ -4562,6 +4548,7 @@
      return $rows;
   
   }
   function upAllUserChange($idarr,$data=array(), $port = null){
      $status      =   $data['status'];
@@ -4614,6 +4601,7 @@
      }
      return $return;
   }
   //审核
   function upUserChange($id,$uid,$moblie,$data=array(), $port = null){
      $status         =      $data['status'];
@@ -4639,6 +4627,7 @@
      }
      return $return;
   }
   /**
    * 身份切换
    * $data     处理的数据
@@ -4711,24 +4700,28 @@
       );
       return $return;
   }
    /**
     * 后台切换身份后处理
     */
   function actUserchange($id,$uid,$usertype,$username,$status,$moblie,$port = null)
   {
    function actUserchange($id, $uid, $usertype, $username, $status, $moblie, $port = null) {
      
      require_once 'notice.model.php';
      $noticeM    =   new notice_model($this->db, $this->def);
      if($status==1){
         
         switch($usertype){
            case '1' : $table = 'resume';
                case '1' :
                    $table = 'resume';
            break;
            case '2' : $table = 'company';
                case '2' :
                    $table = 'company';
            break;
            case '3' : $table = 'lt_info';
                case '3' :
                    $table = 'lt_info';
            break;
            case '4' : $table = 'px_train';
                case '4' :
                    $table = 'px_train';
            break;
         }
      
@@ -4763,6 +4756,7 @@
      }
   
   }
   /**
    * 删除简历
    * @param string $id    格式:单个,如1 ; 批量,如1,2,3
@@ -4784,7 +4778,6 @@
                $ids    =   @explode(',', $id);
         }
         $id             =   pylode(',', $ids);
         
   
         $return['id']   =   $this -> delete_all('user_change',array('id' => array('in',$id)), '');
@@ -4942,8 +4935,7 @@
     * @param string $type
     * @return array|string[]
     */
   function bindacount($data = array(),$type='')
    {
    function bindacount($data = array(), $type = '') {
       $username   =  $data['username'];
       $return     =  array('msg'=>'系统繁忙','errcode'=>8);
@@ -5166,8 +5158,7 @@
     * @param string $provider
     * @return mixed
     */
   function fastReg($data = array(), $type = '', $provider = 'weixin')
   {
    function fastReg($data = array(), $type = '', $provider = 'weixin') {
       // 微信小程序和百度小程序不需要验证
       if($type != 'wxxcx' && $data['moblie']!=''){
@@ -5465,6 +5456,7 @@
       }
       return $return;
   }
   /**
    * 清除其他账号绑定的app推送标识
    */
@@ -5485,4 +5477,5 @@
       }
   }
}
?>