123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?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 $wxid;
- public $nature;
- public $remittanceName;
- public $bankName;
- public $bankNumber;
- public $coupletNumber;
- public $remittanceBankType;
- 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',
- 'wxid',
- 'nature',
- 'remittanceName',
- 'bankName',
- 'bankNumber',
- 'remittanceBankType',
- 'coupletNumber'
- );
- 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 getStaffByName($username = '') {
-
- return $this->getOne ( array (
- 'asc' => 'sid',
- 'where' => "username= '" . $username . "'",
- 'asArray' => TRUE
- ) );
- }
- public function getStaff() {
- Doo::loadClass ( 'XDeode' );
- $XDeode = new XDeode ( 5 );
-
- $list = $this->find ( array (
- 'desc' => 'sid',
- 'asArray' => TRUE
- ) );
- foreach ( $list as $key => $value ) {
- $list [$key] ['sidKey'] = $XDeode->encode ( $value ['sid'] );
- }
-
- return $list;
- }
- public function getStaffInCid($cid = '') {
- if (empty ( $cid ))
- return array ();
- $list = $this->find ( array (
- 'asc' => 'sid',
- 'where' => "cid in(" . $cid . ")",
- 'asArray' => TRUE
- ) );
- Doo::loadClass ( 'XDeode' );
- $XDeode = new XDeode ( 5 );
- foreach ( $list as $key => $value ) {
- $list [$key] ['sidKey'] = $XDeode->encode ( $value ['sid'] );
- }
-
- return $list;
- }
- public function getStaffByCid($cid = 0) {
- $list = $this->find ( array (
- 'asc' => 'sid',
- 'where' => "cid= '" . $cid . "'",
- 'asArray' => TRUE
- ) );
- Doo::loadClass ( 'XDeode' );
- $XDeode = new XDeode ( 5 );
- foreach ( $list as $key => $value ) {
- $list [$key] ['sidKey'] = $XDeode->encode ( $value ['sid'] );
- }
-
- return $list;
- }
- 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;
- }
- public function getStaffByWxid($wxid = '') {
- // echo "wxid in ( " . $wxid . ")";
- if (empty ( $wxid ))
- return array ();
- return $this->find ( array (
- 'select' => 'sid,wxid',
- 'where' => "wxid in ( " . $wxid . ")",
- 'asArray' => TRUE
- ) );
- }
- }
- ?>
|