staff_service.php 897 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. class staff_service {
  3. private $staff;
  4. private $XDeode;
  5. function __construct() {
  6. Doo::loadClass ( 'XDeode' );
  7. $this->XDeode = new XDeode ( 9 );
  8. Doo::loadModel ( 'cld/staff_cld' );
  9. $this->staff = new staff_cld ();
  10. }
  11. public function GetStaffCategoryId($categoryId=0){
  12. if (!is_numeric($categoryId)){
  13. $categoryId=$this->XDeode->decode($categoryId);
  14. }
  15. $list=$this->staff->GetCategoryId($categoryId);
  16. return $list;
  17. }
  18. //验证项目管理登陆
  19. public function authLoginCM($data=array()){
  20. //1.获得账号
  21. if(empty($data)){
  22. throw new Exception("参数错误");
  23. }
  24. $staffInfo=$this->staff->GetName($data['staffName']);
  25. if(empty($staffInfo)){
  26. throw new Exception("员工不存在");
  27. }
  28. $password=md5($data['password']);
  29. if ($password!=$staffInfo['passwork']){
  30. throw new Exception("密码不正确");
  31. }
  32. return $staffInfo;
  33. }
  34. }
  35. ?>