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

namespace JinDouYun\Dao\Stock;

use JinDouYun\Dao\BaseDao;

class DWarehouseBeginning extends BaseDao
{
    public function __construct($serviceDB = 'stock')
    {
        $this->_table = 'warehouse_beginning';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
            'no',
            "warehouseId", //int(10) NOT NULL COMMENT '仓库id',
            "operatorId", //int(10) DEFAULT NULL COMMENT '操作人id',
            "operatorName", //varchar(30) DEFAULT NULL COMMENT '操作人name',
            "remark", //varchar(255) DEFAULT NULL COMMENT '备注',
            "materielId", //int(10) DEFAULT NULL COMMENT '物料id',
            "materielName", //varchar(40) DEFAULT NULL COMMENT '物料名称',
            "materielCode",
            "skuId", //int(10) DEFAULT NULL COMMENT '单位id',
            "num", //decimal(10,8) DEFAULT NULL COMMENT '数量',
            "costPrice", //decimal(10,4) DEFAULT NULL COMMENT '成本价',
            "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);
    }
}