<?php

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

class EmailTask extends DooModel {
	
	public $tid;
	
	public $email_title;
	
	public $email_content;
	
	public $is_send_count;
	
	public $status;
	
	public $faild_uid;
	
	public $send_count;
	
	public $de_email;
	
	public $time;
	
	public $_table = 'zh_email_task';
	
	public $_primarykey = 'tid';
	
	public $_fields = array ('tid', 'email_title', 'email_content', 'is_send_count', 'status', 'faild_uid', 'send_count', 'time','de_email' );
	
	public function __construct() {
		parent::setupModel ( __CLASS__ );
	}
	
	/**
	 * 获取邮件任务
	 */
	function get_email_task() {
		$sql = "select * from " . $this->_table;
		
		$query = Doo::db ()->query ( $sql );
		
		$result = $query->fetchAll ();
		
		return $result;
	}
	
	/**
	 * 获取邮件任务
	 * @param unknown_type $tid
	 */
	function get_email_task_by_tid($tid = 0) {
		$sql = "select * from " . $this->_table . " where tid=" . $tid;
		
		$query = Doo::db ()->query ( $sql );
		
		$result = $query->fetch ();
		
		return $result;
	}
}

?>