2022-06-14 06:07:15 +00:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
|
|
const (
|
2025-05-23 03:02:20 +00:00
|
|
|
|
CouponTypeDeduction = "deduction" // 抵扣
|
|
|
|
|
RenewalMemberActivityId = 1 // 会员续费优惠券
|
|
|
|
|
OpenMemberActivityId = 4 // 开通会员优惠券
|
|
|
|
|
CommonSaleActivityId = 5 // 零售销售(普通会员)
|
2025-06-03 08:05:17 +00:00
|
|
|
|
PrivilegeMemberActivityId = 6 // 零售销售(尊享会员)
|
2025-05-23 03:02:20 +00:00
|
|
|
|
VmActivityId = 9 // 积分兑换优惠券
|
|
|
|
|
NewMachineActivityId = 10 // 主机预订券
|
|
|
|
|
OpenPrivilegeMemberActivityType = 11 // 开通尊享会员优惠券
|
2024-09-14 09:37:22 +00:00
|
|
|
|
)
|
2022-06-23 04:21:01 +00:00
|
|
|
|
|
|
|
|
|
// gen:qs
|
2024-01-31 10:02:20 +00:00
|
|
|
|
//
|
2024-04-03 06:29:19 +00:00
|
|
|
|
// 会员优惠券类型
|
|
|
|
|
//
|
2024-01-31 10:02:20 +00:00
|
|
|
|
//go:generate goqueryset -in coupon.go
|
2022-06-14 06:07:15 +00:00
|
|
|
|
type Coupon struct {
|
|
|
|
|
Model
|
2022-06-29 08:03:50 +00:00
|
|
|
|
|
2024-09-26 03:44:29 +00:00
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Describe string `json:"describe" gorm:"type:text"` // 描述
|
|
|
|
|
Rule string `json:"rule" gorm:"type:text"` // 优惠券使用规则
|
|
|
|
|
CouponType string `json:"coupon_type"` //
|
|
|
|
|
ActivityType uint32 `json:"activity_type"` //
|
|
|
|
|
ActivityId uint32 `json:"activity_id" gorm:"index"` // 活动类型 1-会员续费 2-关注公众号 3-运费包 4-开通会员(2024/7/17新增)5-零售销售(普通会员) 6-零售销售(尊享会员)9-积分兑换优惠券
|
|
|
|
|
Value uint32 `json:"value"` //
|
|
|
|
|
OutCount uint32 `json:"out_count"` // 用户已领取数量
|
|
|
|
|
UsedCount uint32 `json:"used_count"` // 用户已使用数量
|
|
|
|
|
ActiveStart time.Time `json:"active_start"` // 有效期开始
|
|
|
|
|
ActiveEnd time.Time `json:"active_end"` // 有效期结束 零值永不结束
|
|
|
|
|
MemberLevel uint32 `json:"member_level"` // 会员等级 1-用户 2-会员
|
|
|
|
|
CategoryNumber string `json:"category_number"` // 可以使用该优惠券的商品分类,如果为空则表示没限制
|
|
|
|
|
CommodityNumber string `json:"commodity_number"` // 可以使用该优惠券的商品编号,如果为空则表示没限制
|
2025-01-21 01:47:08 +00:00
|
|
|
|
Limit uint32 `json:"limit"` // 优惠券叠加限制 0-不限制;1-仅限原价购买时使用
|
2024-09-26 03:44:29 +00:00
|
|
|
|
IsDraw bool `json:"is_draw" gorm:"-"` //
|
2022-06-14 06:07:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-03 06:29:19 +00:00
|
|
|
|
// 用户优惠券
|
2025-01-09 07:57:20 +00:00
|
|
|
|
// gen:qs
|
2022-06-14 06:07:15 +00:00
|
|
|
|
type UserCoupon struct {
|
|
|
|
|
Model
|
|
|
|
|
|
2022-11-01 06:23:06 +00:00
|
|
|
|
Uid uint32 `json:"uid" gorm:"index"`
|
2024-04-03 06:29:19 +00:00
|
|
|
|
CouponId uint32 `json:"coupon_id" gorm:"index"` // 优惠券id:1-50抵扣券(续费黄金);2-100抵扣券(续费白金);3-200抵扣券(续费黑金);4-5元;5-运费抵扣券(包邮券)
|
|
|
|
|
CouponType string `json:"coupon_type"` //
|
|
|
|
|
ActivityType uint32 `json:"activity_type"` // 活动类型 1-会员续费 2-关注公众号 3-运费包
|
|
|
|
|
ActivityId uint32 `json:"activity_id" gorm:"index"` //
|
|
|
|
|
Value uint32 `json:"value"` //
|
2025-01-22 09:21:33 +00:00
|
|
|
|
State uint32 `json:"state"` // 1-未使用 2-已使用 3-已过期 4-已失效
|
2024-04-03 06:29:19 +00:00
|
|
|
|
ActiveStart time.Time `json:"active_start"` // 有效期开始
|
|
|
|
|
ActiveEnd time.Time `json:"active_end"` // 有效期结束 零值永不结束
|
|
|
|
|
UseTime time.Time `json:"use_time"` //
|
2024-09-14 09:37:22 +00:00
|
|
|
|
MemberLevel uint32 `json:"member_level"` // 会员等级 1-用户 2-会员
|
2024-04-03 06:29:19 +00:00
|
|
|
|
Approach uint32 `json:"approach"` // 获取途径:1-通过店员兑换码获取
|
|
|
|
|
PromotionalSales uint32 `json:"promotional_sales"` // 推广人员用户id
|
|
|
|
|
RedeemCode string `json:"redeem_code"` //
|
2024-09-14 09:37:22 +00:00
|
|
|
|
CategoryNumber string `json:"category_number"` // 可以使用该优惠券的商品分类,如果为空则表示没限制
|
2024-09-26 03:44:29 +00:00
|
|
|
|
CommodityNumber string `json:"commodity_number"` // 可以使用该优惠券的商品编号,如果为空则表示没限制
|
2024-09-14 09:37:22 +00:00
|
|
|
|
Code string `json:"code"` // 优惠券券码
|
2025-01-21 01:47:08 +00:00
|
|
|
|
Limit uint32 `json:"limit"` // 优惠券叠加限制 0-不限制;1-仅限原价购买时使用
|
|
|
|
|
StoreId uint32 `json:"store_id" gorm:"-"` // 邀请码对应门店id
|
2024-04-03 06:29:19 +00:00
|
|
|
|
Availability uint32 `json:"availability" gorm:"-"` // 1-不可用 2-可用
|
2022-11-01 06:23:06 +00:00
|
|
|
|
Coupon *Coupon `json:"coupon" gorm:"-"`
|
2022-06-14 06:07:15 +00:00
|
|
|
|
}
|
2022-06-23 04:21:01 +00:00
|
|
|
|
|
|
|
|
|
// gen:qs
|
|
|
|
|
type Activity struct {
|
|
|
|
|
Model
|
|
|
|
|
|
|
|
|
|
Name string `json:"name" gorm:"column:name;comment:'活动名称'"` // 活动名称
|
2022-09-29 07:49:16 +00:00
|
|
|
|
ActivityType uint32 `json:"activity_type" gorm:"column:activity_type;comment:'活动类型'"` // 活动类型 1-会员续费 2-关注公众号 3-运费包
|
2022-06-23 04:21:01 +00:00
|
|
|
|
State uint32 `json:"state" gorm:"column:state;comment:'状态'"` // 1-未开启 2-进行中 3-已结束
|
|
|
|
|
StartTime time.Time `json:"start_time" gorm:"column:start_time;comment:'开始时间'"` // 开始时间
|
|
|
|
|
EndTime time.Time `json:"end_time" gorm:"column:end_time;comment:'结束时间'"` // 结束时间 零值永不结束
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// gen:qs
|
|
|
|
|
type ActivityMemberRenewal struct {
|
|
|
|
|
Model
|
|
|
|
|
|
2022-07-12 13:20:57 +00:00
|
|
|
|
ActivityId uint32 `json:"activity_id" gorm:"index"`
|
|
|
|
|
Uid uint32 `json:"uid"`
|
|
|
|
|
State uint32 `json:"state" gorm:"column:state;comment:'状态'"` // 1-进行中 2-已完成 3-已过期
|
|
|
|
|
StartTime time.Time `json:"start_time" gorm:"column:start_time;comment:'开始时间'"` // 开始时间
|
|
|
|
|
IsPop bool `json:"is_pop" gorm:"column:is_pop;comment:'是否弹窗'"` // 是否弹窗
|
|
|
|
|
MemberLevel uint32 `json:"member_level" gorm:"column:member_level;comment:'会员等级'"` // 会员等级
|
|
|
|
|
MemberSerial uint32 `json:"member_serial"` // 会员有效
|
2022-06-23 04:21:01 +00:00
|
|
|
|
//StartUseTime time.Time `json:"start_use_time" gorm:"column:start_use_time;comment:'开始使用时间'"` // 开始使用时间
|
|
|
|
|
|
|
|
|
|
}
|