package models import ( "github.com/ouxuanserver/osmanthuswine/src/core" "time" ) const BullyScreenServerTableName = TableNamePrefix + "bully_screen_server" //霸屏服务 type BullyScreenServer struct { Id int64 `json:"id"` ActivityId int64 `json:"activity_id" description:"主活动的id"` ServerStartTime time.Time `json:"server_start_time" description:"服务开始时间"` ServerEndTime time.Time `json:"server_end_time" description:"服务结束时间"` Start string `json:"start" description:"霸屏是否开启 [开启|关闭]"` ServerDisplay string `json:"server_display" description:"霸屏展示的方式 [消息界面|互动界面]"` Price float64 `json:"price" description:"每秒的价格 霸屏"` IsDelete bool `json:"is_delete" xorm:"is_delete"` CreatedAt time.Time `json:"created_at" xorm:"created"` UpdatedAt time.Time `json:"updated_at" xorm:"updated"` } func (t *BullyScreenServer) TableName() string { return BullyScreenServerTableName } func (t *BullyScreenServer) Alias(name string) string { return AliasTableName(t, name) } func (t *BullyScreenServer) GetByActivityId(aid int64) (bool, error) { return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Get(t) }