package models import ( "github.com/ouxuanserver/osmanthuswine/src/core" "time" ) const LotteryDrawActivityTableName = TableNamePrefix + "lottery_draw_activity" //抽奖活动 type LotteryDrawActivity struct { Id int64 `json:"id"` ActivityId int64 `json:"activity_id" description:"主活动的id"` CreatorId int64 `json:"creator_id" description:"创建者id"` LotteryDrawActivityName string `json:"lottery_draw_activity_name" description:"抽奖轮次名称"` LotteryDrawRule *LotteryDrawRule `json:"lottery_draw_rule" xorm:"-" description:"抽奖活动规则"` IsDelete bool `json:"-" xorm:"default(0)"` CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"` UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"` } func (t *LotteryDrawActivity) TableName() string { return LotteryDrawActivityTableName } func GetLDActivityIdsByActivityId(aid int64) ([]int64, error) { lotteryIds := make([]int64, 0) err := core.GetXormAuto().Table(new(LotteryDrawActivity)).Select("id"). Where("is_delete=0 and activity_id=?", aid).Find(&lotteryIds) return lotteryIds, err }