<?php

Doo::loadCore ( 'db/DooModel' );

class C_tooltip extends DooModel {
	
	public $tip;
	public $sid;
	public $cateid;
	public $name;
	public $cid;
	
	public $_table = 'CLD_C_tooltip';
	public $_primarykey = 'tip';
	public $_fields = array ('tip', 'sid','cateid','name','cid');
	
	public function checkUser($uid,$passwork){
		return $this->find ( array ('where' => "uid= '".$uid."' and passwork = '".addslashes($passwork)."'", 'asArray' => TRUE ) );
	}
	
	public function getCategoryById($cid=0,$othercid=""){
		if(!empty($othercid))
			return $this->find ( array ('where' => "cid in ( ".$cid.",".$othercid.") ", 'asArray' => TRUE ) );
		else
			return $this->find ( array ('where' => "cid= '".$cid."' ", 'asArray' => TRUE ) );
	
	}
	
	public function getCategory() {
		return $this->find ( array ('asc' => 'cid', 'asArray' => TRUE ) );
	}

	public function getUserByIdList($puid){
		return $this->find ( array ('where' => "uid= '".$puid."'", 'asArray' => TRUE ) );
	}
	
}

?>