package models import ( "github.com/ouxuanserver/osmanthuswine/src/core" "time" ) const OrderDrawActivityTableName = TableNamePrefix + "order_draw_activity" //订单抽奖活动 type OrderDrawActivity struct { Id int64 `json:"id"` ActivityId int64 `json:"activity_id" description:"活动的id"` CreatorId int64 `json:"creator_id"` OrderDrawActivityName string `json:"order_draw_activity_name"` OrderDrawRule *OrderDrawRule `json:"order_draw_rule" xorm:"-"` MoreAreaMode string `json:"more_area_mode"` IsSuccess bool `json:"is_success"` IsDelete bool `json:"is_delete" xorm:"default(0)"` CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"` UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"` } func (t *OrderDrawActivity) TableName() string { return OrderDrawActivityTableName } func GetODActivityIdsByActivityId(aid int64) ([]int64, error) { orderIds := make([]int64, 0) err := core.GetXormAuto().Table(new(OrderDrawActivity)).Select("id"). Where("is_delete=0 and activity_id=?", aid).Find(&orderIds) return orderIds, err }