staff.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 $hiredate;
  22. public $nature;
  23. public $_table = 'CLD_staff';
  24. public $_primarykey = 'sid';
  25. public $_fields = array ('sid', 'username','birthday','position', 'passwork','isadmin','cid','othercid','appDate','category','othercategory','gender','qq','phone','telephone','email','avatar','hiredate','nature' );
  26. public function checkUser($uid,$passwork){
  27. return $this->find ( array ('select'=>'position,birthday,sid,username,isadmin,cid,othercid,category,othercategory,gender,qq,phone,telephone,email,avatar,hiredate,nature',
  28. 'where' => "username= '".$uid."' and passwork = '".md5($passwork)."'", 'asArray' => TRUE ) );
  29. }
  30. public function getStaff(){
  31. return $this->find ( array ('desc' => 'sid', 'asArray' => TRUE ) );
  32. }
  33. public function getStaffByCid($cid=0) {
  34. return $this->find ( array ('asc' => 'sid','where' => "cid= '".$cid."'", 'asArray' => TRUE ) );
  35. }
  36. public function getUserById($sid=0) {
  37. return $this->find ( array ('asc' => 'sid','where' => "sid= '".$sid."'", 'asArray' => TRUE ) );
  38. }
  39. public function getUserByIdList($puid){
  40. return $this->find ( array ('where' => "sid= '".$puid."'", 'asArray' => TRUE ) );
  41. }
  42. }
  43. ?>