DInventory.Class.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * 库存管理Dao
  4. * Created by PhpStorm.
  5. * User: 小威
  6. * Date: 2019/11/12
  7. * Time: 10:00
  8. */
  9. namespace JinDouYun\Dao\Stock;
  10. use JinDouYun\Dao\BaseDao;
  11. class DInventory extends BaseDao
  12. {
  13. public function __construct($serviceDB = 'stock')
  14. {
  15. $this->_table = 'inventory';
  16. $this->_primary = 'id';
  17. $this->_fields = [
  18. "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  19. "merchantId", //int(10) NOT NULL DEFAULT '0' COMMENT '商户id',
  20. "materielId", //int(10) NOT NULL COMMENT '物料ID',
  21. "materielCode", //varchar(255) DEFAULT NULL COMMENT '物料编码',
  22. "inventoryNum", //decimal(20,8) NOT NULL COMMENT '库存数',
  23. "otherNum", //decimal(20,8) DEFAULT '0.00000000' COMMENT '其他单位数量',
  24. "lockInventory", //decimal(20,8) NOT NULL COMMENT '锁定库存数',
  25. "costPrice", //decimal(15,4) DEFAULT NULL COMMENT '成本价',
  26. "skuId", //int(10) DEFAULT NULL COMMENT '单位id',
  27. "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间',
  28. "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
  29. ];
  30. $this->_readonly = ['id'];
  31. $this->_create_autofill = [
  32. 'createTime' => time(),
  33. 'updateTime' => time()
  34. ];
  35. $this->_update_autofill = [
  36. 'updateTime' => time()
  37. ];
  38. parent::__construct($serviceDB);
  39. }
  40. }