DUserCoupon.Class.php 3.2 KB

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