staff.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. Doo::loadCore ( 'db/DooModel' );
  3. class staff extends DooModel {
  4. public $sid;
  5. public $username;
  6. public $passwork;
  7. public $isadmin;
  8. public $cid;
  9. public $othercid;
  10. public $category;
  11. public $othercategory;
  12. public $gender;
  13. public $qq;
  14. public $phone;
  15. public $telephone;
  16. public $email;
  17. public $birthday;
  18. public $position;
  19. public $avatar;
  20. public $appDate;
  21. public $_table = 'CLD_staff';
  22. public $_primarykey = 'sid';
  23. public $_fields = array ('sid', 'username','birthday','position', 'passwork','isadmin','cid','othercid','appDate','category','othercategory','gender','qq','phone','telephone','email','avatar' );
  24. public function checkUser($uid,$passwork){
  25. return $this->find ( array ('select'=>'position,birthday,sid,username,isadmin,cid,othercid,category,othercategory,gender,qq,phone,telephone,email,avatar',
  26. 'where' => "username= '".$uid."' and passwork = '".md5($passwork)."'", 'asArray' => TRUE ) );
  27. }
  28. public function getStaff(){
  29. return $this->find ( array ('desc' => 'sid', 'asArray' => TRUE ) );
  30. }
  31. public function getStaffByCid($cid=0) {
  32. return $this->find ( array ('asc' => 'sid','where' => "cid= '".$cid."'", 'asArray' => TRUE ) );
  33. }
  34. public function getUserById($sid=0) {
  35. return $this->find ( array ('asc' => 'sid','where' => "sid= '".$sid."'", 'asArray' => TRUE ) );
  36. }
  37. public function getUserByIdList($puid){
  38. return $this->find ( array ('where' => "sid= '".$puid."'", 'asArray' => TRUE ) );
  39. }
  40. }
  41. ?>