DUserCoupon.Class.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * 优惠券记录
  4. * Created by PhpStorm.
  5. * User: XiaoMing
  6. * Date: 2019/12/13
  7. * Time: 16:05
  8. */
  9. namespace JinDouYun\Dao\Market;
  10. use JinDouYun\Dao\BaseDao;
  11. class DUserCoupon extends BaseDao
  12. {
  13. public function __construct($serviceDB = 'default')
  14. {
  15. $this->_table = 'user_coupon';
  16. $this->_primary = 'id';
  17. $this->_fields = [
  18. "id",//int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  19. "couponId",//int(11) unsigned NOT NULL COMMENT '优惠券id',
  20. "name",//varchar(255) NOT NULL DEFAULT '' COMMENT '优惠券名称',
  21. "remark",//varchar(255) NOT NULL DEFAULT '' COMMENT '使用说明',
  22. "couponType",//tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '优惠券类型(10满减券)',
  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. "startTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '有效期开始时间',
  26. "endTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '有效期结束时间',
  27. "applyRange",//tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '适用范围(10全部商品 20指定分类 30指定品牌)',
  28. "categoryCollect",//varchar(255) NOT NULL DEFAULT '' COMMENT '(20指定分类)-分类集合',
  29. "brandCollect",//varchar(255) NOT NULL DEFAULT '' COMMENT '(30指定品牌)-品牌集合',
  30. "goodsCollect",
  31. "isExpire",//tinyint(3) unsigned NOT NULL DEFAULT '4' COMMENT '是否过期(4未过期 5已过期)',
  32. "isUse",//tinyint(3) unsigned NOT NULL DEFAULT '4' COMMENT '是否已使用(4未使用 5已使用)',
  33. "useTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '使用时间',
  34. "userId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  35. "customerId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '客户id',
  36. "shopId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '领取的店铺id',
  37. "useShop",//varchar(255) NOT NULL DEFAULT '' COMMENT '使用范围 为空时所有店铺都能使用',
  38. "source",//tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '优惠券来源(10主动领取 20定向发放 30注册领取 40在线支付赠送)',
  39. "createTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  40. "updateTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  41. "orderData" ,//json DEFAULT NULL COMMENT '订单数据',
  42. "extends",//json DEFAULT NULL COMMENT '拓展字段',
  43. "vipCardId",// int(11) DEFAULT '0' COMMENT '绑定的会员卡Id',
  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. }