<?php
/**
 * 系统公告dao
 * Created by PhpStorm.
 * User: 小威
 * Date: 2020/04/16
 * Time: 17:30
 */

namespace JinDouYun\Dao\System;

use JinDouYun\Dao\BaseDao;

class DAnnouncement extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'announcement';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
            "enterpriseId", //int(10) NOT NULL COMMENT '企业id',
            "title", //varchar(255) NOT NULL COMMENT '标题',
            "content", //text NOT NULL COMMENT '内容',
            "type", //tinyint(1) NOT NULL DEFAULT '4' COMMENT '公告类型 4:企业公告 5:商城公告',
            "status", //tinyint(3) NOT NULL DEFAULT '4' COMMENT '状态 4:禁用 5:启用',
            "upStatus", //tinyint(1) NOT NULL DEFAULT '4' COMMENT '弹出状态 4:禁用 5:弹出',
            "deleteStatus", //tinyint(3) NOT NULL DEFAULT '5' COMMENT '删除状态',
            "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
            "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}