district_staff.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. class district_staff extends DooModel {
  4. public $dsid;
  5. public $did;
  6. public $sid;
  7. public $_table = 'CLD_district_staff';
  8. public $_primarykey = 'dsid';
  9. public $_fields = array('dsid', 'did', 'sid');
  10. function getClientByCid($cid){
  11. $sql = "select * from " . $this->_table . " as a left join CLD_staff as b on (a.sid=b.sid) where a.cid= '".$cid."' " ;
  12. $query = Doo::db ()->query ( $sql );
  13. $result = $query->fetch ();
  14. return $result;
  15. }
  16. function getClientByStaff($condition,$limit){
  17. $sql = "select * from " . $this->_table . " as a left join CLD_client as b on (a.cid=b.cid) where 1 ".$condition." ".$limit ;
  18. $query = Doo::db ()->query ( $sql );
  19. $result = $query->fetchAll ();
  20. return $result;
  21. }
  22. public function getProject(){
  23. return $this->find ( array ('asc' => 'pid', 'asArray' => TRUE ) );
  24. }
  25. public function getProjectByIdList($projectid){
  26. return $this->find ( array ('where' => "pid= '".$projectid."'", 'asArray' => TRUE ) );
  27. }
  28. }
  29. ?>