| | |
| | | <?php |
| | | |
| | | |
| | | |
| | | class userinfo_model extends model |
| | | { |
| | | class userinfo_model extends model { |
| | | |
| | | private $comstatusStr =array( |
| | | 0 => ' 被设为未审核状态', |
| | |
| | | 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); |
| | |
| | | } |
| | | |
| | | // 获取账户信息 |
| | | function getInfo($where,$data=array()) |
| | | { |
| | | function getInfo($where, $data = array()) { |
| | | |
| | | $field = empty($data['field']) ? '*' : $data['field']; |
| | | |
| | |
| | | } |
| | | |
| | | //修改用户信息 |
| | | public function upInfo($whereData = array(), $upData = array(), $data = array()) |
| | | { |
| | | public function upInfo($whereData = array(), $upData = array(), $data = array()) { |
| | | |
| | | if (!empty($whereData)) { |
| | | //处理password |
| | |
| | | return $this->update_once('member', $upData, $whereData); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 用户注册检测,修改基本信息检测 |
| | | * @param $data |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | private function setMemberInfo($uid, $utype, $up, $oldMem) |
| | | { |
| | | |
| | | private function setMemberInfo($uid, $utype, $up, $oldMem) { |
| | | |
| | | $uData = array(); |
| | | |
| | |
| | | * @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)) { |
| | | |
| | |
| | | return $this->select_once($table, $whereData, $field); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据用户类型,直接批量查找用户信息 |
| | | * @param array $whereData |
| | |
| | | return $this -> select_all($table,$whereData,$field); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据用户类型,修改用户信息 |
| | | */ |
| | |
| | | |
| | | return $this->update_once($table,$data['post'],$Where); |
| | | } |
| | | |
| | | /** |
| | | * 获取不同类型用户姓名、企业名称、头像 |
| | | */ |
| | |
| | | return $List; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据不同类型用户的搜索条件获取uid集合 |
| | | * $whereData[1]:resume表查询条件 |
| | |
| | | |
| | | return $return; |
| | | } |
| | | |
| | | /** |
| | | * 锁定用户(账户锁定和相关用户类型审核是否通过没有关系) |
| | | * @param array $whereData |
| | |
| | | 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'); |
| | |
| | | * @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']; |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | /** |
| | | * 会员审核发送通知 |
| | | * @param $uid 参数格式:uid = array('in', '1,2,3'); uid = 1; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //后台个人会员列表处理数据 |
| | | private function getDataList($List){ |
| | | |
| | |
| | | |
| | | return $List; |
| | | } |
| | | |
| | | /** |
| | | * @desc 生成password(包括原密码验证) |
| | | * |
| | |
| | | |
| | | return $pwdRes; |
| | | } |
| | | |
| | | /** |
| | | * 删除个人会员 |
| | | */ |
| | | private function delUser($uid){ |
| | | |
| | | if (!empty($uid)){ |
| | | |
| | | |
| | | |
| | | $return = $this -> delete_all('resume',array('uid'=>array('in',$uid)),''); |
| | |
| | | return $return; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除猎头会员 |
| | | */ |
| | |
| | | return $return; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除培训会员 |
| | | */ |
| | |
| | | if (!empty($uid)){ |
| | | |
| | | |
| | | |
| | | $return = $this -> delete_all('gq_info',array('uid'=>array('in',$uid)), ''); |
| | | |
| | | if ($return){ |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | /** |
| | | * @desc 修改用户名 |
| | | * @param array $data |
| | |
| | | return $List; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取member_reg信息 |
| | | * 通用的data数组 |
| | |
| | | return $nid; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 上传个人头像 |
| | | */ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 个人身份认证 |
| | | */ |
| | |
| | | return $return; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理单个图片上传 |
| | | * @param file/需上传文件; dir/上传目录; type/上传图片类型; base/需上传base64; preview/pc预览即上传 |
| | |
| | | * @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']; |
| | |
| | | // 未注册手机登录直接注册新账号 |
| | | $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{ |
| | |
| | | } |
| | | } |
| | | |
| | | if(CheckRegUser($username)==false && CheckRegEmail($username)==false && ($username!='')){ |
| | | if (!CheckRegUser($username) && !CheckRegEmail($username) && ($username != '')) { |
| | | return array('msg'=>'用户名或密码不正确!','errcode'=>'8'); |
| | | } |
| | | |
| | |
| | | |
| | | //开启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{ |
| | |
| | | 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']; |
| | | } |
| | | |
| | |
| | | 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 { |
| | |
| | | } |
| | | |
| | | if($res){ |
| | | |
| | | //更新用户QQ互联ID |
| | | if (session_id() == ''){ |
| | | session_start(); |
| | |
| | | $return['user']['spid'] = 1; |
| | | } |
| | | } |
| | | |
| | | return $return; |
| | | }else{ |
| | | |
| | | return array('msg'=>'用户名或密码不正确!','errcode'=>'8'); |
| | | $return = array('msg' => '用户名或密码不正确!', 'errcode' => '8'); |
| | | } |
| | | return $return; |
| | | } |
| | |
| | | * @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'); |
| | |
| | | * @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); |
| | |
| | | * @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`')); |
| | |
| | | * @param array $data |
| | | * @return array $return |
| | | */ |
| | | function upUserType($data = array()) |
| | | { |
| | | function upUserType($data = array()) { |
| | | $uid = intval($data['uid']); |
| | | |
| | | $usertype = intval($data['usertype']); |
| | |
| | | * @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)); |
| | | |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | /** |
| | | * 小程序和app账号绑定(微信、QQ、新浪微博) |
| | | */ |
| | | public function loginBind($data) |
| | | { |
| | | public function loginBind($data) { |
| | | if(!empty($data)){ |
| | | |
| | | if (empty($data['openid'])){ |
| | |
| | | return $return; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 小程序和app第三方登录检测(微信、QQ、新浪微博) |
| | | */ |
| | | public function loginCheck($data) |
| | | { |
| | | public function loginCheck($data) { |
| | | |
| | | if ($data['type'] == 'weixin'){ |
| | | |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | /** |
| | | * 微信小程序通过解密getPhoneNumber接口参数,来获取手机号。 然后检测是否绑定账号,没绑定的,自动注册账号 |
| | | */ |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | //申请切换用户列表 |
| | | public function getUserChangeList($where,$data=array()){ |
| | | $usertype = array('1'=>'个人会员','2'=>'企业会员','3'=>'猎头会员','4'=>'培训会员'); |
| | |
| | | $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()){ |
| | | |
| | |
| | | return $rows; |
| | | |
| | | } |
| | | |
| | | function upAllUserChange($idarr,$data=array(), $port = null){ |
| | | |
| | | $status = $data['status']; |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | //审核 |
| | | function upUserChange($id,$uid,$moblie,$data=array(), $port = null){ |
| | | $status = $data['status']; |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | /** |
| | | * 身份切换 |
| | | * $data 处理的数据 |
| | |
| | | ); |
| | | 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; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除简历 |
| | | * @param string $id 格式:单个,如1 ; 批量,如1,2,3 |
| | |
| | | $ids = @explode(',', $id); |
| | | } |
| | | $id = pylode(',', $ids); |
| | | |
| | | |
| | | |
| | | $return['id'] = $this -> delete_all('user_change',array('id' => array('in',$id)), ''); |
| | |
| | | * @param string $type |
| | | * @return array|string[] |
| | | */ |
| | | function bindacount($data = array(),$type='') |
| | | { |
| | | function bindacount($data = array(), $type = '') { |
| | | |
| | | $username = $data['username']; |
| | | $return = array('msg'=>'系统繁忙','errcode'=>8); |
| | |
| | | * @param string $provider |
| | | * @return mixed |
| | | */ |
| | | function fastReg($data = array(), $type = '', $provider = 'weixin') |
| | | { |
| | | function fastReg($data = array(), $type = '', $provider = 'weixin') { |
| | | |
| | | // 微信小程序和百度小程序不需要验证 |
| | | if($type != 'wxxcx' && $data['moblie']!=''){ |
| | |
| | | } |
| | | return $return; |
| | | } |
| | | |
| | | /** |
| | | * 清除其他账号绑定的app推送标识 |
| | | */ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | ?> |