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

namespace JinDouYun\Dao\Stock;

use JinDouYun\Dao\BaseDao;

class DLockingShop extends BaseDao
{
    public function __construct($serviceDB = 'stock')
    {
        $this->_table = 'locking_shop';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
            "shopId", //int(10) DEFAULT NULL COMMENT '商铺id',
            "materielId", //int(10) NOT NULL COMMENT '物料ID',
            "materielCode", //varchar(255) DEFAULT NULL COMMENT '物料编码',
            "lockInventory", //decimal(20,8) NOT NULL COMMENT '锁定库存数',
            "skuId", //int(10) DEFAULT NULL COMMENT '单位id',
            "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(),
            'updateTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}