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

namespace JinDouYun\Dao\Stock;

use JinDouYun\Dao\BaseDao;

class DInventoryOut extends BaseDao
{
    public function __construct($serviceDB = 'stock')
    {
        $this->_table = 'inventory_out';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '主键自增',
            "no", //char(25) NOT NULL COMMENT '出库单号',
            "sourceId", //int(10) NOT NULL COMMENT '来源Id',
            "sourceNo", //char(25) NOT NULL COMMENT '来源单号',
            "originNo", //char(25) NOT NULL COMMENT '源头单号',
            "originId", //int(10) NOT NULL COMMENT '源头id',
            "materielNum", //int(10) DEFAULT NULL COMMENT '出库商品数量',
            "amount", //decimal(15,4) DEFAULT NULL COMMENT '出库总金额',
            "shopId", //int(10) NOT NULL COMMENT '商铺ID',
            "shopName", //varchar(50) NOT NULL COMMENT '商铺名称',
            "operatorId", //int(10) DEFAULT NULL COMMENT '操作人id',
            "operatorName", //varchar(255) DEFAULT NULL COMMENT '操作人姓名',
            "auditId", //int(10) DEFAULT NULL COMMENT '审核人id',
            "auditName", //varchar(30) DEFAULT NULL COMMENT '审核人姓名',
            "customerId", //int(10) DEFAULT NULL COMMENT '客户id',
            "customerName", //varchar(20) DEFAULT NULL COMMENT '客户姓名',
            "customerCode", //varchar(255) DEFAULT NULL COMMENT '客户编码',
            "customerMobile", //char(11) DEFAULT NULL COMMENT '客户电话',
            "remark", //varchar(255) DEFAULT NULL COMMENT '备注',
            "source", //tinyint(3) DEFAULT NULL COMMENT '订单来源(出库类型)',
            "deliveryType", //tinyint(3) DEFAULT NULL COMMENT '配送方式',
            "type", //tinyint(3) DEFAULT NULL COMMENT '单据类型',
            "deleteStatus", //tinyint(3) DEFAULT NULL COMMENT '删除状态 5:正常 4:删除',
            "outStatus", //tinyint(1) DEFAULT NULL COMMENT '出库状态 1:待出库 2:全部出库 3:部分出库',
            "auditStatus", //tinyint(3) DEFAULT NULL COMMENT '审核状态1 :未审核 2:已审核',
            "auditTime", //int(10) DEFAULT NULL COMMENT '审核日期',
            "createTime", //int(10) DEFAULT NULL COMMENT '创建时间/制单时间',
            "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间',
            "extend", //json DEFAULT NULL COMMENT '拓展字段',
            "serialNum", //varchar(20) DEFAULT '0' COMMENT '序号',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}