<?php
/**
 * 仓库调拨管理Dao
 * Created by PhpStorm.
 * User: 小威
 * Date: 2019/11/29
 * Time: 15:00
 */

namespace JinDouYun\Dao\Stock;

use JinDouYun\Dao\BaseDao;

class DAllocateDetails extends BaseDao
{
    public function __construct($serviceDB = 'stock')
    {
        $this->_table = 'allocate_details';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
            "linkId", //int(10) DEFAULT NULL COMMENT '连接id',
            "linkNo", //char(20) DEFAULT NULL COMMENT '连接单号',
            "materielId", //int(10) DEFAULT NULL COMMENT '物料id',
            "materielName", //varchar(30) DEFAULT NULL COMMENT '物料名称',
            "materielCode", //varchar(20) DEFAULT NULL COMMENT '物料编号',
            "skuId", //int(10) DEFAULT NULL COMMENT '单位id',
            "num", //decimal(20,8) DEFAULT NULL COMMENT '数量',
            "otherNum",// decimal(20,8) DEFAULT NULL COMMENT '其他单位',
            "costUnitPrice", //decimal(10,4) DEFAULT NULL COMMENT '成本单价',
            "deleteStatus", //
            "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
            "updateTime", //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);
    }
}