修改优惠卷

This commit is contained in:
wucongxing8150 2024-06-03 16:29:55 +08:00
parent f514dd16c1
commit 0dac42527f
2 changed files with 15 additions and 15 deletions

View File

@ -7,18 +7,18 @@ import (
// UserCouponDto 用户优惠卷表
type UserCouponDto struct {
UserCouponId string `json:"user_coupon_id"` // 主键id
UserId string `json:"user_id"` // 用户id
PatientId string `json:"patient_id"` // 患者id
CouponId string `json:"coupon_id"` // 优惠卷id
UserCouponStatus int `json:"user_coupon_status"` // 状态0:未使用 1:已使用 3:已过期)
CouponUseDate model.LocalTime `json:"coupon_use_date"` // 使用时间
ValidStartTime model.LocalTime `json:"valid_start_time"` // 有效使用时间
ValidEndTime model.LocalTime `json:"valid_end_time"` // 过期使用时间
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
Coupon *CouponDto `json:"coupon"` // 优惠卷
UserName string `json:"user_name"` // 用户名称
UserCouponId string `json:"user_coupon_id"` // 主键id
UserId string `json:"user_id"` // 用户id
PatientId string `json:"patient_id"` // 患者id
CouponId string `json:"coupon_id"` // 优惠卷id
UserCouponStatus int `json:"user_coupon_status"` // 状态0:未使用 1:已使用 3:已过期)
CouponUseDate *model.LocalTime `json:"coupon_use_date"` // 使用时间
ValidStartTime model.LocalTime `json:"valid_start_time"` // 有效使用时间
ValidEndTime model.LocalTime `json:"valid_end_time"` // 过期使用时间
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
Coupon *CouponDto `json:"coupon"` // 优惠卷
UserName string `json:"user_name"` // 用户名称
}
// GetUserCouponDto 用户优惠卷详情
@ -29,7 +29,7 @@ func GetUserCouponDto(m *model.UserCoupon) *UserCouponDto {
PatientId: fmt.Sprintf("%d", m.PatientId),
CouponId: fmt.Sprintf("%d", m.CouponId),
UserCouponStatus: m.UserCouponStatus,
CouponUseDate: model.LocalTime(*m.CouponUseDate),
CouponUseDate: m.CouponUseDate,
ValidStartTime: model.LocalTime(m.ValidStartTime),
ValidEndTime: model.LocalTime(m.ValidEndTime),
CreatedAt: m.CreatedAt,
@ -50,7 +50,7 @@ func GetUserCouponListDto(m []*model.UserCoupon) []*UserCouponDto {
PatientId: fmt.Sprintf("%d", v.PatientId),
CouponId: fmt.Sprintf("%d", v.CouponId),
UserCouponStatus: v.UserCouponStatus,
CouponUseDate: model.LocalTime(*v.CouponUseDate),
CouponUseDate: v.CouponUseDate,
ValidStartTime: model.LocalTime(v.ValidStartTime),
ValidEndTime: model.LocalTime(v.ValidEndTime),
CreatedAt: v.CreatedAt,

View File

@ -13,7 +13,7 @@ type UserCoupon struct {
PatientId int64 `gorm:"column:patient_id;type:bigint(19);comment:患者id" json:"patient_id"`
CouponId int64 `gorm:"column:coupon_id;type:bigint(19);comment:优惠卷id;NOT NULL" json:"coupon_id"`
UserCouponStatus int `gorm:"column:user_coupon_status;type:tinyint(1);default:0;comment:状态0:未使用 1:已使用 3:已过期)" json:"user_coupon_status"`
CouponUseDate *time.Time `gorm:"column:coupon_use_date;type:datetime;comment:使用时间" json:"coupon_use_date"`
CouponUseDate *LocalTime `gorm:"column:coupon_use_date;type:datetime;comment:使用时间" json:"coupon_use_date"`
ValidStartTime time.Time `gorm:"column:valid_start_time;type:datetime;comment:有效使用时间" json:"valid_start_time"`
ValidEndTime time.Time `gorm:"column:valid_end_time;type:datetime;comment:过期使用时间" json:"valid_end_time"`
Model