DInventoryDetails.Class.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 DInventoryDetails extends BaseDao
  12. {
  13. public function __construct($serviceDB = 'stock')
  14. {
  15. $this->_table = 'inventory_details';
  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. "warehouseId", //int(10) NOT NULL COMMENT '仓库id',
  21. "originId", //int(10) NOT NULL COMMENT '业务来源id',
  22. "originNo", //char(25) NOT NULL COMMENT '业务来源no',
  23. "materielId", //int(10) NOT NULL COMMENT '物料id',
  24. "materielCode", //varchar(255) NOT NULL COMMENT '物料编码',
  25. "materielName", //varchar(255) NOT NULL COMMENT '物料名称',
  26. "sourceNo", //char(20) NOT NULL COMMENT '来源单号',
  27. "source", //tinyint(3) NOT NULL COMMENT '单据来源标识',
  28. "operatorId", //int(10) NOT NULL COMMENT '操作人id',
  29. "operatorName", //varchar(50) NOT NULL COMMENT '操作人姓名',
  30. "skuId", //int(10) NOT NULL COMMENT '单位id',
  31. "unitName", //varchar(255) DEFAULT NULL COMMENT '单位名称',
  32. "skuName", //varchar(255) DEFAULT NULL COMMENT '属性名称',
  33. "inventoryNum", //decimal(20,8) NOT NULL COMMENT '库存数',
  34. "otherNum", //decimal(20,8) DEFAULT '0.00000000' COMMENT '其他单位数量',
  35. "inventoryChangeNum", //decimal(20,8) NOT NULL COMMENT '变动后库存数量',
  36. "batch", //json NOT NULL COMMENT '批次信息',
  37. "costType", //tinyint(3) NOT NULL DEFAULT '1' COMMENT '计算成本方式 1:移动加权 2:个别计价',
  38. "averageCost", //decimal(15,4) NOT NULL COMMENT '均价成本',
  39. "actionType", //tinyint(3) NOT NULL COMMENT '出入库操作标识 5:入库 4:出库',
  40. "createTime", //int(10) NOT NULL COMMENT '创建时间',
  41. "updateTime", //int(10) NOT NULL COMMENT '更新时间',
  42. "extend", //json DEFAULT NULL COMMENT '扩展字段',
  43. ];
  44. $this->_readonly = ['id'];
  45. $this->_create_autofill = [
  46. 'createTime' => time()
  47. ];
  48. $this->_update_autofill = [
  49. 'updateTime' => time()
  50. ];
  51. parent::__construct($serviceDB);
  52. }
  53. }