<?php
/**
 * 出库详情管理Dao
 * Created by PhpStorm.
 * User: 小威
 * Date: 2019/11/11
 * Time: 14:00
 */

namespace JinDouYun\Dao\Stock;

use JinDouYun\Dao\BaseDao;

class DInventoryOutDetails extends BaseDao
{
    public function __construct($serviceDB = 'stock')
    {
        $this->_table = 'inventory_out_details';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
            "linkId", //int(10) DEFAULT NULL COMMENT '出库id',
            "linkNo", //char(25) DEFAULT NULL COMMENT '出库单号',
            "outWarehouse", //json DEFAULT NULL COMMENT '出库仓库',
            "materielId", //int(10) DEFAULT NULL COMMENT '商品id',
            "materielName", //varchar(255) DEFAULT NULL COMMENT '商品名称',
            "materielCode", //varchar(50) DEFAULT NULL COMMENT '商品编号',
            "skuId", //int(10) DEFAULT NULL COMMENT '单位id',
            "unitName", //varchar(255) DEFAULT NULL COMMENT '单位名称',
            "skuName", //varchar(255) DEFAULT NULL COMMENT '属性名称',
            "skuStorage", //varchar(255) DEFAULT NULL COMMENT '货架编码',
            "num", //decimal(20,8) DEFAULT NULL COMMENT '待出库数量',
            "outNum", //decimal(20,8) DEFAULT NULL COMMENT '已出库数量',
            "total", //decimal(20,8) DEFAULT NULL COMMENT '总出库数量',
            "unitPrice", //decimal(15,4) DEFAULT NULL COMMENT '单价',
            "totalPrice", //decimal(15,4) DEFAULT NULL COMMENT '总价',
            "areaId",// int(10) DEFAULT '0' COMMENT '库区id',
          "areaName",// varchar(255) DEFAULT NULL COMMENT '库区名称',
          "areaCode",// varchar(255) DEFAULT NULL COMMENT '库区编码',
          "storageLocationId",// int(10) DEFAULT '0' COMMENT '库位id',
          "storageLocationName",// varchar(255) DEFAULT NULL COMMENT '库位名称',
          "storageLocationCode",// varchar(255) DEFAULT NULL COMMENT '库位编码',
            "outStatus", //tinyint(1) DEFAULT NULL COMMENT '出库状态 1:待出库 2:全部出库 3:部分出库',
            "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);
    }
}