<?php
/**
 * 消耗品库存
 * Created by PhpStorm.
 * User: wxj
 * Date: 2019/10/31
 * Time: 15:02
 */

namespace JinDouYun\Dao\Stock;

use JinDouYun\Dao\BaseDao;

class DConsume extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'consume';
        $this->_primary = 'id';
        $this->_fields = [
            'id',// int unsigned NOT NULL AUTO_INCREMENT,
            'userCenterId',// int NOT NULL COMMENT '调拨人',
            'write',// int NOT NULL COMMENT '核销人',
            'enterpriseId',// int NOT NULL,
            'shopId',// int NOT NULL,
            'warehouseId',// int NOT NULL COMMENT '仓库',
            'name',// varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品名',
            'image',// varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
            'status',// tinyint NOT NULL COMMENT '1使用中2使用完',
            'number',// int NOT NULL COMMENT '数量',
            'price',// decimal(10,2) NOT NULL COMMENT '价格',
            'createTime',// int NOT NULL COMMENT '出仓日期',
            'writeTime',// int NOT NULL COMMENT '核销日期',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}