model

package
v0.0.0-...-0a16eaf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateCouponByCouponId

func UpdateCouponByCouponId(svc *svc.ServiceContext, couponUserId int64, status int32) error

Types

type Coupon

type Coupon struct {
	gorm.Model
	StartDate       time.Time `json:"start_date"       gorm:"type:datetime;comment:开始日期"`
	EndDate         time.Time `json:"end_date"         gorm:"type:datetime;comment:结束日期"`
	CouponType      int32     `json:"coupon_type"      gorm:"type:tinyint(1);not null;comment: 1满减券 2打折券 3抵扣券"`
	CouponName      string    `json:"coupon_name"      gorm:"type:varchar(255);not null;comment:优惠券名称"`
	DiscountAmount  int64     `json:"discount_amount"  gorm:"type:int(10);comment:优惠金额或比例"` //打折券0到99
	UsageConditions int64     `json:"usage_conditions" gorm:"type:int(10);comment:使用条件"`
}

func GetCouponByCouponId

func GetCouponByCouponId(svc *svc.ServiceContext, couponId int64) (coupons Coupon, err error)

func GetCouponList

func GetCouponList(svc *svc.ServiceContext, couponId []int64) (coupons []Coupon, err error)

type CouponUser

type CouponUser struct {
	gorm.Model
	CouponID   int64     `json:"coupon_id"   gorm:"type:int(11);comment:优惠券id"`
	UserID     int64     `json:"user_id"     gorm:"type:int(11);comment:用户id"`
	AccessTime time.Time `json:"access_time" gorm:"type:datetime;comment:获取时间"`
	Status     int32     `json:"status"      gorm:"type:tinyint(1);index;comment: 0未使用 1已使用 2已过期"`
}

type CouponsInfo

type CouponsInfo struct {
	CouponUserID    int64     `json:"coupon_user_id"`
	UserID          int64     `json:"user_id"`
	StartDate       time.Time `json:"start_date"`
	EndDate         time.Time `json:"end_date"`
	Status          int32     `json:"status"`
	AccessTime      time.Time `json:"access_time"`
	CouponID        int64     `json:"coupon_id"`
	CouponType      int32     `json:"coupon_type"`
	CouponName      string    `json:"coupon_name"`
	DiscountAmount  int64     `json:"discount_amount"`
	UsageConditions int64     `json:"usage_conditions"`
}

func GetCouponByCouponUserId

func GetCouponByCouponUserId(svc *svc.ServiceContext, userId, couponUserId int64) (CouponsInfo, error)

func GetCouponUserList

func GetCouponUserList(svc *svc.ServiceContext, userID int64, status int32) (couponUserList []CouponsInfo, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL