互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.3 KiB

package models
import (
"time"
"github.com/ouxuanserver/osmanthuswine/src/core"
)
const OrderDrawActivityTableName = TableNamePrefix + "order_draw_activity"
//订单抽奖活动
type OrderDrawActivity struct {
Id int `json:"id" xorm:"not null autoincr pk INT(11)`
ActivityId int `json:"activity_id" description:"活动的id"`
CreatorId int `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 int) ([]int, error) {
orderIds := make([]int, 0)
err := core.GetXormAuto().Table(new(OrderDrawActivity)).Select("id").
Where("is_delete=0 and activity_id=?", aid).Find(&orderIds)
return orderIds, err
}