<?php
/**
 * 仓库管理Dao
 * Created by PhpStorm.
 * User: 小威
 * Date: 2019/11/08
 * Time: 14:30
 */

namespace JinDouYun\Dao\Stock;

use JinDouYun\Dao\BaseDao;

class DWarehouse extends BaseDao
{
    public function __construct($serviceDB = 'stock')
    {
        $this->_table = 'warehouse';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
            "shopId", //int(10) DEFAULT NULL COMMENT '商铺Id',
            "warehouseCode", //varchar(50) DEFAULT NULL COMMENT '仓库编码',
            "warehouseName", //varchar(255) DEFAULT NULL COMMENT '仓库名称',
            "contactName", //varchar(255) DEFAULT NULL COMMENT '联系人姓名',
            "contactMobile", //char(11) DEFAULT NULL COMMENT '联系方式/手机号',
            "provinceCode", //int(10) DEFAULT NULL COMMENT '省份编码',
            "cityCode", //int(10) DEFAULT NULL COMMENT '城市编码',
            "districtCode", //int(10) DEFAULT NULL COMMENT '区县编码',
            "contactAddress", //varchar(255) DEFAULT NULL COMMENT '仓库地址',
            "remarks", //varchar(255) DEFAULT NULL COMMENT '备注',
            "beginningStatus", // tinyint(3) NOT NULL DEFAULT '5' COMMENT '期初状态 5:正常 4:禁用',
            "enableStatus", //tinyint(3) DEFAULT '5' COMMENT '启用状态 4:未启用 5:启用',
            "deleteStatus", //tinyint(3) DEFAULT '5' COMMENT '删除状态 4:删除 5:正常',
            "updateTime", //int(10) DEFAULT NULL COMMENT '更新时间',
            "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
            "extend", //json DEFAULT NULL COMMENT '扩展字段',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}