Dao.php 1.19 KB
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: elkan
 * Date: 14-8-18
 * Time: 下午6:04
 * To change this template use File | Settings | File Templates.
 */
use YHMSupport\SqlMap\Notice;

class YHMSupport_Models_Notice_Dao extends YHMSupport_Dao {

    private $_tag = 'yhm_passport_user_notice_setting';

    public function __construct() {
        $this->router = 'user_notice_setting.yhm_passport';
    }

    /**
     * 
     * @return type
     */
    function getOne($uid) {
        return $this->dao()->cache(false)->fetchRow(Notice\Notice::SELECT_NOTICE_BY_UID, array('uid' => $uid));
    }

    /**
     * 
     * @param number $product_skc
     * @param number $order_by
     * @param number $create_uid
     */
    function setNoticeByUid($uid, $message_notice, $order_notice, $system_notice, $start_time, $end_time) {
        $params = array(
            'uid' => $uid,
            'message_notice' => $message_notice,
            'order_notice' => $order_notice,
            'system_notice' => $system_notice,
            'start_time' => $start_time,
            'end_time' => $end_time
        );
        return $this->dao()->cache(false)->insert(Notice\Notice::SET_NOTICE_BY_UID, $params);
    }

}