lecturer.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. class lecturer extends DooModel {
  4. public $lid;
  5. public $sid;
  6. public $staff;
  7. public $mold;
  8. public $cid;
  9. public $category;
  10. public $ltype;
  11. public $_table = 'CLD_lecturer';
  12. public $_primarykey = 'lid';
  13. public $_fields = array('lid', 'sid', 'staff','mold','cid','category','ltype');
  14. /**
  15. * 是否有查看日常收支的权限
  16. */
  17. function getLecturerAll(){
  18. Doo::loadClass ( 'XDeode' );
  19. $XDeode = new XDeode ( 5 );
  20. $list = $this->find ( array (
  21. 'asArray' => true
  22. ) );
  23. foreach ($list as $key=>$value){
  24. $list[$key]['lidKey']=$XDeode->encode ( $value ['lid'] );
  25. }
  26. return $list;
  27. }
  28. /**
  29. * 根据ID删除数据
  30. * @param number $itid
  31. */
  32. function delLecturerByLid($lid = 0) {
  33. Doo::loadClass ( 'XDeode' );
  34. $XDeode = new XDeode ( 5 );
  35. if (!is_numeric($lid))
  36. $lid = $XDeode->decode ( $lid );
  37. if (! empty ( $lid )&&is_numeric($lid))
  38. $this->delete ( array (
  39. 'where' => 'lid=' . $lid ,
  40. 'limit'=>1
  41. ) );
  42. }
  43. }
  44. ?>