DPurchase.Class.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * 采购Dao
  4. * Created by PhpStorm.
  5. * User: XiaoMing
  6. * Date: 2019/11/11
  7. * Time: 17:46
  8. */
  9. namespace JinDouYun\Dao\Purchase;
  10. use JinDouYun\Dao\BaseDao;
  11. class DPurchase extends BaseDao
  12. {
  13. public function __construct($serviceDB = 'stock')
  14. {
  15. $this->_table = 'purchase';
  16. $this->_primary = 'id';
  17. $this->_fields = [
  18. "id", //int(10) NOT NULL AUTO_INCREMENT,
  19. "no", //char(25) NOT NULL COMMENT '采购单号',
  20. "shopId", //int(10) DEFAULT NULL COMMENT '商铺id',
  21. "merchantId", // int(10) NOT NULL DEFAULT '0' COMMENT '商户id',
  22. "merchantName" ,//varchar(255) NOT NULL COMMENT '商户名称',
  23. "warehouseId", //int(10) DEFAULT NULL COMMENT '仓库id',
  24. "warehouseName", //varchar(50) DEFAULT NULL COMMENT '仓库名称',
  25. "supplierId", //int(10) NOT NULL DEFAULT '0' COMMENT '供应商Id',
  26. "supplierName", //varchar(255) NOT NULL DEFAULT '' COMMENT '供应商名称',
  27. "buyerId", //int(10) NOT NULL DEFAULT '0' COMMENT '采购人员Id',
  28. "buyerName", //varchar(255) NOT NULL DEFAULT '' COMMENT '采购人员名称',
  29. "remark", //varchar(255) DEFAULT '' COMMENT '备注',
  30. "operatorId", //int(10) NOT NULL DEFAULT '0' COMMENT '制单人员Id',
  31. "operatorName", //varchar(255) NOT NULL DEFAULT '' COMMENT '制单人名',
  32. "purchaseAmount", //decimal(15,4) DEFAULT '0.0000' COMMENT '采购金额',
  33. "couponAmount", //decimal(15,4) DEFAULT '0.0000' COMMENT '优惠金额',
  34. "otherAmount", //decimal(15,4) DEFAULT '0.0000' COMMENT '其他金额',
  35. "goodsNum", //decimal(20,8) NOT NULL COMMENT '采购商品数量',
  36. "extends", //json DEFAULT NULL COMMENT '拓展字段',
  37. "returnStatus", //tinyint(3) DEFAULT '0' COMMENT '退货状态 0:未退货 1:部分退货 2:全部退货',
  38. "purchaseType", // tinyint(3) NOT NULL DEFAULT '4' COMMENT '采购类型 4:采购订单 5:商户采购单',
  39. "inStatus", //tinyint(3) DEFAULT '4' COMMENT '单据入库状态 4:未入库 5:已入库',
  40. "auditStatus", //tinyint(3) NOT NULL DEFAULT '1' COMMENT '审核状态 默认1 待审 2审核通过 3审核未通过 4审核中',
  41. "deleteStatus", //tinyint(3) NOT NULL DEFAULT '5' COMMENT '是否删除 默认5 正常 4删除',
  42. "auditId", //int(10) NOT NULL DEFAULT '0' COMMENT '审核人员Id',
  43. "auditName", //varchar(255) NOT NULL DEFAULT '' COMMENT '审核人员名册',
  44. "auditTime", //int(10) NOT NULL DEFAULT '0' COMMENT '审核时间',
  45. "createTime", //int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
  46. "updateTime", //int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
  47. "serialNum", //varchar(50) DEFAULT '' COMMENT '序号',
  48. 'havaRefund'
  49. ];
  50. $this->_readonly = ['id'];
  51. $this->_create_autofill = [
  52. 'createTime' => time()
  53. ];
  54. $this->_update_autofill = [
  55. 'updateTime' => time()
  56. ];
  57. parent::__construct($serviceDB);
  58. }
  59. }