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.
31 lines
1.6 KiB
31 lines
1.6 KiB
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/ouxuanserver/osmanthuswine/src/core"
|
|
)
|
|
|
|
const RewardServerTableName = TableNamePrefix + "reward_server"
|
|
|
|
//打赏服务
|
|
type RewardServer struct {
|
|
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
|
|
ActivityId int `json:"activity_id" xorm:"not null comment('主活动id')" description:"主活动id"`
|
|
ServerStartTime time.Time `json:"server_start_time" xorm:"not null comment('服务开始时间')" description:"服务开始时间"`
|
|
ServerEndTime time.Time `json:"server_end_time" xorm:"not null comment('服务结束时间')" description:"服务结束时间"`
|
|
ServerDisplay string `json:"server_display" xorm:"not null comment('霸屏展示的方式 [消息界面|互动界面]')" description:"霸屏展示的方式 [消息界面|互动界面]"`
|
|
ServerStart string `json:"server_start" xorm:"not null comment('打赏服务是否开启 [开启|关闭]')" description:"打赏服务是否开启 [开启|关闭]"`
|
|
IsExpire string `json:"is_expire" xorm:"not null comment('是否过期了 此字段应该由脚本去执行 当时间大于服务结束时间时 server_start为关闭 本字段未已过期')"`
|
|
IsDelete bool `json:"-" xorm:"default(0)"`
|
|
CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"`
|
|
UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"`
|
|
}
|
|
|
|
func (t *RewardServer) TableName() string {
|
|
return RewardServerTableName
|
|
}
|
|
|
|
func (t *RewardServer) GetByActivityId(aid int) (bool, error) {
|
|
return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Get(t)
|
|
}
|