DPurchaseGoods.Class.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * 采购商品明细Dao
  4. * Created by PhpStorm.
  5. * User: XiaoMing
  6. * Date: 2019/11/11
  7. * Time: 17:53
  8. */
  9. namespace JinDouYun\Dao\Purchase;
  10. use JinDouYun\Dao\BaseDao;
  11. class DPurchaseGoods extends BaseDao
  12. {
  13. public function __construct($serviceDB = 'stock')
  14. {
  15. $this->_table = 'purchase_goods';
  16. $this->_primary = 'id';
  17. $this->_fields = [
  18. "id", //int(10) NOT NULL AUTO_INCREMENT,
  19. "purchaseId", //int(10) NOT NULL DEFAULT '0' COMMENT '采购单id',
  20. "goodsCode", //varchar(50) NOT NULL DEFAULT '' COMMENT '商品编码',
  21. "goodsName", //varchar(50) NOT NULL DEFAULT '' COMMENT '商品名称',
  22. "categoryId", //int(10) DEFAULT NULL COMMENT '分类id',
  23. "categoryName", //varchar(255) DEFAULT NULL COMMENT '分类名称',
  24. "unitName", //varchar(255) DEFAULT NULL COMMENT '单位名称',
  25. "skuName", //varchar(255) DEFAULT NULL COMMENT '属性名称',
  26. "buyerNum", //decimal(20,8) DEFAULT '0.00000000' COMMENT '采购数量',
  27. "inNum", //decimal(20,8) DEFAULT '0.00000000' COMMENT '入库数量',
  28. "otherNum",// decimal(20,8) DEFAULT '0.00000000' COMMENT '其他单位数量',
  29. "inOfNum", //decimal(20,8) DEFAULT '0.00000000' COMMENT '未入库数量',
  30. "returnOnNum", //decimal(20,8) DEFAULT NULL COMMENT '可退数量',
  31. "returnNum", //decimal(20,8) DEFAULT '0.00000000' COMMENT '退货数量',
  32. "buyerUnitPrice", //decimal(15,4) DEFAULT '0.0000' COMMENT '采购单价',
  33. "subtotalPrice", //decimal(15,4) DEFAULT '0.0000' COMMENT '小计金额(数量*单价)',
  34. "couponAmount", //decimal(15,4) DEFAULT '0.0000' COMMENT '优惠金额',
  35. "otherAmount", //decimal(15,4) DEFAULT '0.0000' COMMENT '其他金额',
  36. "inStatus", //tinyint(1) DEFAULT '4' COMMENT '入库状态 4:未入库 5:全部入库 6:部分入库',
  37. "returnStatus", //tinyint(3) DEFAULT '0' COMMENT '退货状态 0未退货 1部分退货 2全部退货',
  38. "deleteStatus", //tinyint(3) NOT NULL DEFAULT '5' COMMENT '是否删除 默认5 正常 4删除',
  39. "extends", //json DEFAULT NULL COMMENT '拓展字段',
  40. "createTime", //int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
  41. "updateTime", //int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
  42. "basicGoodsId", //int(10) NOT NULL DEFAULT '0' COMMENT '基础商品id',
  43. "skuId", //int(10) DEFAULT NULL COMMENT 'skuId',
  44. ];
  45. $this->_readonly = ['id'];
  46. $this->_create_autofill = [
  47. 'createTime' => time()
  48. ];
  49. $this->_update_autofill = [
  50. 'updateTime' => time()
  51. ];
  52. parent::__construct($serviceDB);
  53. }
  54. }