邹方成 425e64daa5 refactor: 优化订单时间字段处理及数据库模型结构调整
- 将订单的PaidAt和CancelledAt从指针类型改为值类型
- 统一时间字段的判空逻辑,使用IsZero()替代nil检查
- 调整多个数据库模型结构,添加新字段并优化字段顺序
- 为活动奖励设置、用户邀请等表添加新字段
- 更新对应的DAO层代码以匹配模型变更
2025-12-23 23:37:59 +08:00

55 lines
4.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package model
import (
"time"
"gorm.io/gorm"
)
const TableNameActivities = "activities"
// Activities 活动
type Activities struct {
ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP(3);comment:创建时间" json:"created_at"` // 创建时间
UpdatedAt time.Time `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP(3);comment:更新时间" json:"updated_at"` // 更新时间
Name string `gorm:"column:name;not null;comment:活动名称" json:"name"` // 活动名称
Banner string `gorm:"column:banner;comment:活动横幅/海报URL" json:"banner"` // 活动横幅/海报URL
ActivityCategoryID int64 `gorm:"column:activity_category_id;comment:活动所属分类IDactivity_categories.id可空" json:"activity_category_id"` // 活动所属分类IDactivity_categories.id可空
Status int32 `gorm:"column:status;not null;default:1;comment:状态1进行中 2下线" json:"status"` // 状态1进行中 2下线
PriceDraw int64 `gorm:"column:price_draw;comment:活动门票价格" json:"price_draw"` // 活动门票价格
IsBoss int32 `gorm:"column:is_boss;comment:Boss: 1 是 0 不是" json:"is_boss"` // Boss: 1 是 0 不是
AllowItemCards bool `gorm:"column:allow_item_cards;not null;default:1;comment:是否允许使用道具卡" json:"allow_item_cards"` // 是否允许使用道具卡
AllowCoupons bool `gorm:"column:allow_coupons;not null;default:1;comment:是否允许使用优惠券" json:"allow_coupons"` // 是否允许使用优惠券
StartTime time.Time `gorm:"column:start_time;comment:开始时间" json:"start_time"` // 开始时间
EndTime time.Time `gorm:"column:end_time;comment:结束时间" json:"end_time"` // 结束时间
DrawMode string `gorm:"column:draw_mode;not null" json:"draw_mode"`
PlayType string `gorm:"column:play_type;not null" json:"play_type"`
MinParticipants int64 `gorm:"column:min_participants;not null" json:"min_participants"`
IntervalMinutes int64 `gorm:"column:interval_minutes;not null" json:"interval_minutes"`
ScheduledTime time.Time `gorm:"column:scheduled_time" json:"scheduled_time"`
LastSettledAt time.Time `gorm:"column:last_settled_at" json:"last_settled_at"`
RefundCouponID int64 `gorm:"column:refund_coupon_id;not null" json:"refund_coupon_id"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
Image string `gorm:"column:image;comment:活动图片地址" json:"image"` // 活动图片地址
CommitmentAlgo string `gorm:"column:commitment_algo;default:commit-v1" json:"commitment_algo"`
CommitmentSeedMaster []byte `gorm:"column:commitment_seed_master" json:"commitment_seed_master"`
CommitmentSeedHash []byte `gorm:"column:commitment_seed_hash" json:"commitment_seed_hash"`
CommitmentStateVersion int32 `gorm:"column:commitment_state_version" json:"commitment_state_version"`
CommitmentItemsRoot []byte `gorm:"column:commitment_items_root" json:"commitment_items_root"`
GameplayIntro string `gorm:"column:gameplay_intro;comment:玩法介绍" json:"gameplay_intro"` // 玩法介绍
DailySeed string `gorm:"column:daily_seed" json:"daily_seed"`
DailySeedDate string `gorm:"column:daily_seed_date;comment:种子日期(YYYY-MM-DD)" json:"daily_seed_date"` // 种子日期(YYYY-MM-DD)
LastDailySeed string `gorm:"column:last_daily_seed;comment:昨日种子" json:"last_daily_seed"` // 昨日种子
LastDailySeedDate string `gorm:"column:last_daily_seed_date;comment:昨日种子日期" json:"last_daily_seed_date"` // 昨日种子日期
}
// TableName Activities's table name
func (*Activities) TableName() string {
return TableNameActivities
}