DInventoryBatch.Class.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * 库存批次管理Dao
  4. * Created by PhpStorm.
  5. * User: phperstar
  6. * Date: 2019/12/10
  7. * Time: 10:00
  8. */
  9. namespace JinDouYun\Dao\Stock;
  10. use JinDouYun\Dao\BaseDao;
  11. class DInventoryBatch extends BaseDao
  12. {
  13. public function __construct($serviceDB = 'stock')
  14. {
  15. $this->_table = 'inventory_batch';
  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. "originId", //int(10) DEFAULT NULL COMMENT '源头id',
  21. "originNo", //char(25) DEFAULT NULL COMMENT '源头单号',
  22. "warehouseId", //int(10) NOT NULL COMMENT '仓库id',
  23. "materielId", //int(10) NOT NULL COMMENT '物料id',
  24. "materielCode", //varchar(255) NOT NULL COMMENT '物料编码',
  25. "sourceNo", //varchar(50) NOT NULL COMMENT '编号',
  26. "skuId", //int(10) NOT NULL COMMENT 'skuid',
  27. "batchNo", //varchar(50) NOT NULL COMMENT '批次编号',
  28. "num", //decimal(20,8) NOT NULL COMMENT '批次可用数量',
  29. "otherNum", //decimal(20,8) unsigned DEFAULT '0.00000000' COMMENT '其他单位数量',
  30. "averageCost", //decimal(15,4) NOT NULL COMMENT '均价成本',
  31. "batchCost", //decimal(15,4) NOT NULL COMMENT '批次成本',
  32. "productionData", //int(10) DEFAULT NULL COMMENT '生产日期',
  33. "shelfLife", //int(10) DEFAULT NULL COMMENT '保质期',
  34. "batchStatus", //tinyint(3) DEFAULT '5' COMMENT '批次状态 4:禁用 5:正常',
  35. "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
  36. "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间',
  37. "extend", //json DEFAULT NULL COMMENT '扩展字段',
  38. ];
  39. $this->_readonly = ['id'];
  40. $this->_create_autofill = [
  41. 'createTime' => time(),
  42. 'updateTime' => time()
  43. ];
  44. $this->_update_autofill = [
  45. 'updateTime' => time()
  46. ];
  47. parent::__construct($serviceDB);
  48. }
  49. }