_table = 'coupon'; $this->_primary = 'id'; $this->_fields = [ "id", //int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '优惠券id', "startTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '固定时间-开始时间', "endTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '固定时间-结束时间', "name", //varchar(255) NOT NULL DEFAULT '' COMMENT '优惠券名称', "couponType", //tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '优惠券类型(10普通优惠券 20会员卡优惠券)', "reducePrice", //decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '满减券-减免金额(面值)', "minPrice", //decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低消费金额 0.00不限金额', "remark", //varchar(255) NOT NULL DEFAULT '' COMMENT '使用说明', "grantType", //tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '发放方式(10主动领取 20定向发放 30注册领取 40在线支付赠送 50会员卡开卡赠送)', "totalNum", //int(11) NOT NULL DEFAULT '0' COMMENT '发放总数量(-1为不限制)', "allowNum", //int(11) NOT NULL DEFAULT '0' COMMENT '每人限制领取数量(-1为不限制)', "customerSourceId", //'领取范围', "mustCondition", //decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '(40在线支付赠送)-满X金额发放 0.00所有在线支付不限金额可领取这个优惠券', "grantStartTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发放开始时间', "grantEndTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发放结束时间', "useShop", //varchar(255) NOT NULL DEFAULT '' COMMENT '使用店铺 为空时所有店铺都能使用', "applyRange", //tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '适用范围(10全部商品 20指定分类 30指定品牌)', "categoryCollect", //varchar(255) NOT NULL DEFAULT '' COMMENT '(20指定分类)-分类集合', "brandCollect", //varchar(255) NOT NULL DEFAULT '' COMMENT '(30指定品牌)-品牌集合', "goodsCollect", "receiveNum", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '已领取数量', "sort", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '排序方式(数字越大越靠前)', "deleteStatus", //tinyint(3) unsigned NOT NULL DEFAULT '5' COMMENT '软删除(5未删除 4已删除)', "auditStatus", //tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '审核状态(1待审 2审核通过 3未通过 4审核中)', "createTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', "updateTime", //int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', "extends", //json DEFAULT NULL COMMENT '拓展字段', "customerIds",//varchar(255) NOT NULL DEFAULT '' COMMENT '领取客户 为空时所有客户都能领取', "isMutex",//tinyint(3) unsigned NOT NULL DEFAULT '5' COMMENT '是否互斥(5是 4否)', "enableStatus",//tinyint(3) unsigned NOT NULL DEFAULT '5' COMMENT '是否互斥(5启用 4禁用)', ]; $this->_readonly = ['id']; $this->_create_autofill = [ 'createTime' => time() ]; $this->_update_autofill = [ 'updateTime' => time() ]; parent::__construct($serviceDB); } }