<?php

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

class execute extends DooModel {

    public $eid;
    public $description;
    public $staff;
    public $mold;
    
    public $_table = 'CLD_execute';
    public $_primarykey = 'eid';
    
    public $_fields = array('eid', 'description', 'staff','mold');

    
    /**
     * 是否有查看日常收支的权限
     */
    function isPaymentsShow($sid){
    	
    	$list = $this->find ( array (
    			'where' => '(staff like \'%["' . $sid . '%\'  ) and mold="日常收支"',
    			'asArray' => true
    	) );
    	if (empty($list)){
    		return false;
    	}else {
    		return true;
    	}
    }
    /*
    function getClientByCid($cid){
    	$sql = "select * from " . $this->_table . " as a left join CLD_staff as b on (a.sid=b.sid)  where a.cid= '".$cid."' " ;
		
    	$query = Doo::db ()->query ( $sql );
		
		$result = $query->fetch ();
		
		return $result;
    }
    
    public function getProjectByIdList($projectid){
    	return $this->find ( array ('where' => "pid= '".$projectid."'", 'asArray' => TRUE ) );
    }
    */
}

?>