_table = 'inventory'; $this->_primary = 'id'; $this->_fields = [ "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id', "merchantId", //int(10) NOT NULL DEFAULT '0' COMMENT '商户id', "materielId", //int(10) NOT NULL COMMENT '物料ID', "materielCode", //varchar(255) DEFAULT NULL COMMENT '物料编码', "inventoryNum", //decimal(20,8) NOT NULL COMMENT '库存数', "otherNum", //decimal(20,8) DEFAULT '0.00000000' COMMENT '其他单位数量', "lockInventory", //decimal(20,8) NOT NULL COMMENT '锁定库存数', "costPrice", //decimal(15,4) DEFAULT NULL COMMENT '成本价', "skuId", //int(10) DEFAULT NULL COMMENT '单位id', "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间', "createTime", //int(10) DEFAULT NULL COMMENT '创建时间', ]; $this->_readonly = ['id']; $this->_create_autofill = [ 'createTime' => time(), 'updateTime' => time() ]; $this->_update_autofill = [ 'updateTime' => time() ]; parent::__construct($serviceDB); } }