1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- Doo::loadCore ( 'db/DooModel' );
- class staff extends DooModel {
- public $sid;
- public $username;
- public $passwork;
- public $isadmin;
- public $cid;
- public $othercid;
- public $category;
- public $othercategory;
- public $gender;
- public $qq;
- public $phone;
- public $telephone;
- public $email;
- public $birthday;
- public $position;
- public $avatar;
- public $appDate;
- public $hiredate;
- public $nature;
- public $_table = 'CLD_staff';
- public $_primarykey = 'sid';
- public $_fields = array (
- 'sid',
- 'username',
- 'birthday',
- 'position',
- 'passwork',
- 'isadmin',
- 'cid',
- 'othercid',
- 'appDate',
- 'category',
- 'othercategory',
- 'gender',
- 'qq',
- 'phone',
- 'telephone',
- 'email',
- 'avatar',
- 'hiredate',
- 'nature'
- );
- public function checkUser($uid, $passwork) {
- return $this->find ( array (
- 'select' => 'position,birthday,sid,username,isadmin,cid,othercid,category,othercategory,gender,qq,phone,telephone,email,avatar,hiredate,nature',
- 'where' => "username= '" . $uid . "' and passwork = '" . md5 ( $passwork ) . "'",
- 'asArray' => TRUE
- ) );
- }
- public function getStaff() {
- return $this->find ( array (
- 'desc' => 'sid',
- 'asArray' => TRUE
- ) );
- }
- public function getStaffByCid($cid = 0) {
- return $this->find ( array (
- 'asc' => 'sid',
- 'where' => "cid= '" . $cid . "'",
- 'asArray' => TRUE
- ) );
- }
- public function getUserById($sid = 0) {
- return $this->find ( array (
- 'asc' => 'sid',
- 'where' => "sid= '" . $sid . "'",
- 'asArray' => TRUE
- ) );
- }
- public function getUserByIdList($puid) {
- Doo::loadClass ( 'XDeode' );
- $XDeode = new XDeode ( 5 );
-
- $puid = $XDeode->decode ( $puid );
- return $this->find ( array (
- 'where' => "sid= '" . $puid . "'",
- 'asArray' => TRUE
- ) );
- }
- /**
- * 根据用户ID获取相关信息
- * @param number $sid 用户ID
- */
- public function getStaffBySid($sid = 0) {
- $detail = array ();
- if (! empty ( $sid ))
- $detail = $this->getOne ( array (
- 'where' => "sid= '" . $sid . "'",
- 'asArray' => TRUE
- ) );
- return $detail;
- }
- }
- ?>
|