L_category.php 978 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. Doo::loadCore ( 'db/DooModel' );
  3. class L_category extends DooModel {
  4. public $cid;
  5. public $title;
  6. public $defult;
  7. public $districtid;
  8. public $_table = 'CLD_L_category';
  9. public $_primarykey = 'cid';
  10. public $_fields = array ('cid', 'title','defult','districtid');
  11. public function checkUser($uid,$passwork){
  12. return $this->find ( array ('where' => "uid= '".$uid."' and passwork = '".addslashes($passwork)."'", 'asArray' => TRUE ) );
  13. }
  14. public function getCategoryById($cid=0,$othercid=""){
  15. if(!empty($othercid))
  16. return $this->find ( array ('where' => "cid in ( ".$cid.",".$othercid.") ", 'asArray' => TRUE ) );
  17. else
  18. return $this->find ( array ('where' => "cid= '".$cid."' ", 'asArray' => TRUE ) );
  19. }
  20. public function getCategory() {
  21. return $this->find ( array ('asc' => 'cid', 'asArray' => TRUE ) );
  22. }
  23. public function getUserByIdList($puid){
  24. return $this->find ( array ('where' => "uid= '".$puid."'", 'asArray' => TRUE ) );
  25. }
  26. }
  27. ?>