123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- Doo::loadModel('uprofile');
- class Profile
- {
- private $uprofile;
- public function __construct()
- {
- $this->uprofile = new Uprofile();
- }
- public function insertProfile($intp = array())
- {
- if (!isset($intp['userid']))
- return FALSE;
- $this->uprofile->userid = filter_var($intp['userid'], FILTER_VALIDATE_INT);
- $this->uprofile->name = filter_var($intp['realname'], FILTER_SANITIZE_STRING);
- $this->uprofile->company = filter_var($intp['company'], FILTER_SANITIZE_STRING);
- $this->uprofile->jobs = filter_var($intp['jobs'], FILTER_SANITIZE_STRING);
- $this->uprofile->remark = filter_var($intp['remark'], FILTER_SANITIZE_STRING);
- $this->uprofile->phone = filter_var($intp['phone'], FILTER_SANITIZE_STRING);
- // $this->uprofile->mobile = filter_var($intp['mobile'], FILTER_SANITIZE_STRING);
- if (isset($intp['qq']))
- $this->uprofile->qq = filter_var($intp['qq'], FILTER_SANITIZE_STRING);
- $this->uprofile->groups = 'vip';
- return $this->uprofile->insert();
- }
- public function ZGinsertProfile($uid = 0, $realname)
- {
- if (!isset($uid))
- return FALSE;
- $this->uprofile->userid = $uid;
- $this->uprofile->name = $realname;
- $this->uprofile->company = '';
- $this->uprofile->jobs = '';
- $this->uprofile->phone = '';
- $this->uprofile->mobile = '';
- $this->uprofile->qq = '';
- $this->uprofile->groups = 'vip';
- return $this->uprofile->insert();
- }
- public function getProWithUid($userid = 0)
- {
- if (!isset($userid))
- return FALSE;
- return $this->uprofile->getOne(array('where' => 'userid=?', 'param' => array($userid), 'asArray' => TRUE));
- }
- public function getVerifiedMobile($userid = 0)
- {
- if (!isset($userid))
- return FALSE;
- return $this->uprofile->getOne(array('where' => 'userid=? and isnotice=1', 'param' => array($userid), 'asArray' => TRUE));
- }
- public function setAvatar($userid = 0, $avaurl)
- {
- if (!isset($userid))
- return FALSE;
- $this->uprofile->avatar = $avaurl;
- return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
- }
- public function setSignPath($userid = 0, $avaurl)
- {
- if (!isset($userid))
- return FALSE;
- $this->uprofile->signpath = $avaurl;
- return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
- }
- public function upProfile($userid, $proArray)
- {
- $this->uprofile->name = $proArray['name'];
- $this->uprofile->company = $proArray['company'];
- $this->uprofile->jobs = $proArray['jobs'];
- $this->uprofile->remark = $proArray['remark'];
- $this->uprofile->phone = $proArray['phone'];
- $this->uprofile->mobile = $proArray['mobile'];
- if (isset($proArray['qq']) && $proArray['qq'])
- $this->uprofile->qq = $proArray['qq'];
- return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
- }
- public function updateMobile($userid, $mobile)
- {
- $this->uprofile->mobile = $mobile;
- $this->uprofile->isnotice = 1;
- return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
- }
- public function checkMobile($number)
- {
- return $this->uprofile->count(array('where' => 'mobile=?', 'param' => array($number), 'asArray' => TRUE));
- }
- public function checkUserName($name)
- {
- return $this->uprofile->getOne(array('select' => 'userid,name,company,jobs', 'where' => 'name LIKE "%'.$name.'%"', 'userid' => 'asc', 'limit' => 1, 'asArray' => TRUE));
- }
- }
- ?>
|