<?php

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

class lecturer extends DooModel {

    public $lid;
    public $sid;
    public $staff;
    public $mold;
    public $cid;
    public $category;
    public $ltype;
    
    public $_table = 'CLD_lecturer';
    public $_primarykey = 'lid';
    
    public $_fields = array('lid', 'sid', 'staff','mold','cid','category','ltype');

    
    /**
     * 是否有查看日常收支的权限
     */
    function getLecturerAll(){
    	Doo::loadClass ( 'XDeode' );
    	$XDeode = new XDeode ( 5 );
    	$list = $this->find ( array (
    			'asArray' => true
    	) );
    	foreach ($list as $key=>$value){
    		$list[$key]['lidKey']=$XDeode->encode ( $value ['lid'] );
    	}
    	
    	
    	return $list;
    }
    /**
	 * 根据ID删除数据
	 * @param number $itid
	 */
	function delLecturerByLid($lid = 0) {
		Doo::loadClass ( 'XDeode' );
		$XDeode = new XDeode ( 5 );
		
		if (!is_numeric($lid))
			$lid = $XDeode->decode ( $lid );
		
		if (! empty ( $lid )&&is_numeric($lid))
			$this->delete ( array (
					'where' => 'lid=' . $lid ,
					'limit'=>1
			) );
	}
}

?>