1.模板设计
例:
现有两种类型优惠券,直减券,满减券,要求设计其发放数量可控,领取数量可控,发放时间可控,生效失效时间可控。
CREATE TABLE `t_coupon_temp` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(200) DEFAULT NULL COMMENT '名称',
`coupon_type` varchar(255) DEFAULT NULL COMMENT '优惠券类型:1直减现金券2满减现金券',
`coupon_amout` decimal(22,2) DEFAULT NULL COMMENT '优惠金额',
`full_amount` decimal(22,2) DEFAULT NULL COMMENT '满减金额',
`grant_start_time` datetime DEFAULT NULL COMMENT '发放开始时间',
`grant_end_time` datetime DEFAULT NULL COMMENT '发放结束时间',
`effective_start_time` datetime DEFAULT NULL COMMENT '生效时间',
`effective_end_time` datetime DEFAULT NULL COMMENT '失效时间',
`status` int(11) DEFAULT '0' COMMENT '状态: -1删除0编辑中1已提交2启用3发放中4暂停5结束',
`quantity` int(1