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.
33 lines
1.2 KiB
33 lines
1.2 KiB
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
|
|
}
|