DCoupon.Class.php 3.7 KB

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