DCoupon.Class.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: XiaoMing
  5. * Date: 2019/12/16
  6. * Time: 15:55
  7. */
  8. namespace Jobs\Dao;
  9. class DCoupon extends BaseDao
  10. {
  11. public function __construct($serviceDB = 'default')
  12. {
  13. $this->_table = 'coupon';
  14. $this->_primary = 'id';
  15. $this->_fields = [
  16. "id", //int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '优惠券id',
  17. "startTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '固定时间-开始时间',
  18. "endTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '固定时间-结束时间',
  19. "name", //varchar(255) NOT NULL DEFAULT '' COMMENT '优惠券名称',
  20. "couponType", //tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '优惠券类型(10满减券)',
  21. "reducePrice", //decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '满减券-减免金额(面值)',
  22. "minPrice", //decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低消费金额 0.00不限金额',
  23. "remark", //varchar(255) NOT NULL DEFAULT '' COMMENT '使用说明',
  24. "grantType", //tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '发放方式(10主动领取 20定向发放 30注册领取 40在线支付赠送)',
  25. "totalNum", //int(11) NOT NULL DEFAULT '0' COMMENT '发放总数量(-1为不限制)',
  26. "allowNum", //int(11) NOT NULL DEFAULT '0' COMMENT '每人限制领取数量(-1为不限制)',
  27. "customerSourceId", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '领取范围',
  28. "mustCondition", //decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '(40在线支付赠送)-满X金额发放 0.00所有在线支付不限金额可领取这个优惠券',
  29. "grantStartTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发放开始时间',
  30. "grantEndTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发放结束时间',
  31. "useShop", //varchar(255) NOT NULL DEFAULT '' COMMENT '使用店铺 为空时所有店铺都能使用',
  32. "applyRange", //tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '适用范围(10全部商品 20指定分类 30指定品牌)',
  33. "categoryCollect", //varchar(255) NOT NULL DEFAULT '' COMMENT '(20指定分类)-分类集合',
  34. "brandCollect", //varchar(255) NOT NULL DEFAULT '' COMMENT '(30指定品牌)-品牌集合',
  35. "goodsCollect",
  36. "receiveNum", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '已领取数量',
  37. "sort", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '排序方式(数字越大越靠前)',
  38. "deleteStatus", //tinyint(3) unsigned NOT NULL DEFAULT '5' COMMENT '软删除(5未删除 4已删除)',
  39. "auditStatus", //tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '审核状态(1待审 2审核通过 3未通过 4审核中)',
  40. "createTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  41. "updateTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  42. "extends", //json DEFAULT NULL COMMENT '拓展字段',
  43. "grantStatus",//tinyint(3) unsigned NOT NULL DEFAULT '5' COMMENT 'grantType==20发放状态(4未发放 5已发放)',
  44. "customerIds",//varchar(255) NOT NULL DEFAULT '' COMMENT '领取客户 为空时所有客户都能领取',
  45. "isMutex",//tinyint(3) unsigned NOT NULL DEFAULT '5' COMMENT '是否互斥(5是 4否)',
  46. ];
  47. $this->_readonly = ['id'];
  48. $this->_create_autofill = [
  49. 'createTime' => time()
  50. ];
  51. $this->_update_autofill = [
  52. 'updateTime' => time()
  53. ];
  54. parent::__construct($serviceDB);
  55. }
  56. }