<?php
/**
 * 商品基础数据分类Dao
 * Created by PhpStorm.
 * User: XiaoMing
 * Date: 2019/10/30
 * Time: 17:11
 */

namespace JinDouYun\Dao\GoodsCategory;

use JinDouYun\Dao\BaseDao;

class DGoodsCategory extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'goods_category';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT,
            "code", //varchar(255) NOT NULL DEFAULT '' COMMENT '分类编码',
            "images", //varchar(255) NOT NULL DEFAULT '' COMMENT '分类图片',
            "pid", //int(10) NOT NULL DEFAULT '0' COMMENT '上级分类id',
            "sort", //int(10) NOT NULL DEFAULT '0' COMMENT '排序规则 数字越大越靠前',
            "title", //varchar(255) NOT NULL DEFAULT '' COMMENT '分类名称',
            "notCustomerType", //int(10) DEFAULT '0' COMMENT '屏蔽客户类型',
            "extends", //json DEFAULT NULL COMMENT '拓展字段',
            "enableStatus", //tinyint(3) NOT NULL DEFAULT '5' COMMENT '显示状态  默认5 显示 6隐藏',
            "deleteStatus", //tinyint(3) NOT NULL DEFAULT '5' COMMENT '是否删除  默认5 正常 4删除',
            "createTime", //int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
            "updateTime", //int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
            "link", //varchar(255) NOT NULL DEFAULT '' COMMENT '分类链路',
            "adImage", //varchar(255) NOT NULL DEFAULT '' COMMENT '一级分类广告图片',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}