<?php

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

class sms extends DooModel {
	
	public $sid;
	public $title;
	public $content;
	public $signature;
	public $client;
	public $illegal;
	public $status;
	public $kind;
	public $mark;
	public $tag;
	public $districtId;
	public $category;
	public $staffId;
	public $staffName;
	public $errorInfo;
	public $date;
	
	public $_table = 'CLD_sms';
	public $_primarykey = 'sid';
	public $_fields = array ('sid', 'title','content','signature', 'client','illegal','status','kind','mark','tag','districtId','category','staffId','staffName','errorInfo','date' );
	
	public function checkUser($uid,$passwork){
		return $this->find ( array ('select'=>'sid,username,isadmin,cid,othercid,category,othercategory,gender,qq,phone,telephone,email,avatar','where' => "username= '".$uid."' and passwork = '".addslashes($passwork)."'", 'asArray' => TRUE ) );
	}
	
	public function getStaff(){
		
		return $this->find ( array ('desc' => 'sid', 'asArray' => TRUE ) );
	}
	
	public function getStaffByCid($cid=0) {
		return $this->find ( array ('asc' => 'sid','where' => "cid= '".$cid."'", 'asArray' => TRUE ) );
	}
	
	
	public function getUserById($sid=0) {
		return $this->find ( array ('asc' => 'sid','where' => "sid= '".$sid."'", 'asArray' => TRUE ) );
	}

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

?>