Client.php 1.3 KB
<?php

/**
 * User: elkan
 * Date: 14-8-5
 * Time: 下午6:04
 */
class YHMSupport_Models_Notice_Client {

    /**
     *
     * @var YHMSupport_Models_Notice_Dao
     */
    private static $dao;

    /**
     *
     * @return YHMSupport_Models_Notice_Dao
     */
    static private function dao() {
        if (empty(self::$dao)) {
            self::$dao = new YHMSupport_Models_Notice_Dao();
        }
        return self::$dao;
    }

    /**
     * 通知信息
     * @return type
     */
    static function getOne($uid) {
        if ((int) $uid < 1) {
            return 0;
        }
        return self::dao()->getOne((int) $uid);
    }

    /**
     * 修改通知状态
     * @param int $uid
     * @param string $message_notice
     * @param string $order_notice
     * @param string $system_notice
     * @param int $start_time
     * @param int $end_time
     * @return type
     */
    public static function setNoticeByUid($uid, $message_notice, $order_notice, $system_notice, $start_time, $end_time) {
        if ((int) $uid < 1 || empty($message_notice) || empty($order_notice) || empty($system_notice) || empty($start_time) || empty($end_time)) {
            return 0;
        }
        return self::dao()->setNoticeByUid((int)$uid, $message_notice, $order_notice, $system_notice, $start_time, $end_time);
    }

}