department.php 574 B

123456789101112131415161718192021222324252627
  1. <?php
  2. Doo::loadCore ( 'db/DooModel' );
  3. class department extends DooModel {
  4. public $did;
  5. public $cid;
  6. public $departmentName;
  7. public $_table = 'CLD_department';
  8. public $_primarykey = 'did';
  9. public $_fields = array (
  10. 'cid',
  11. 'departmentName',
  12. 'did'
  13. );
  14. public function getDepartmentBycid($cid = 0) {
  15. return $this->find ( array (
  16. 'where' => "cid= '" . $cid . "' ",
  17. 'asArray' => TRUE
  18. ) );
  19. }
  20. public function getDepartmentByDid($did = 0) {
  21. return $this->getOne ( array (
  22. 'where' => "did= '" . $did . "' ",
  23. 'asArray' => TRUE
  24. ) );
  25. }
  26. }
  27. ?>