<?php
/**
 * 消息Dao
 * Created by PhpStorm.
 * User: 小威
 * Date: 2020/03/31
 * Time: 15:41
 */

namespace JinDouYun\Dao\Message;

use JinDouYun\Dao\BaseDao;

class DMessage extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'message';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
            "sendId", //int(10) NOT NULL DEFAULT '0' COMMENT '发送人id 0为系统发送',
            "receiveId", //int(10) NOT NULL COMMENT '接收人id',
            "title", //varchar(255) NOT NULL COMMENT '标题',
            "content", //text NOT NULL COMMENT '内容',
            "receiveStatus", //tinyint(3) NOT NULL COMMENT '已读状态 4:未读 5:已读',
            "type", //tinyint(3) NOT NULL COMMENT '类型 1:库存不足消息',
            "deleteStatus",
            "sendTime", //int(10) NOT NULL COMMENT '发送时间',
            "receiveTime", //int(10) DEFAULT NULL COMMENT '接收时间',
            "createTime", //int(10) NOT NULL COMMENT '创建时间',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}
