互动
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

5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
  1. package models
  2. import (
  3. "time"
  4. "git.ouxuan.net/tommy/osmanthuswine/src/core"
  5. )
  6. const RewardServerTableName = TableNamePrefix + "reward_server"
  7. //打赏服务
  8. type RewardServer struct {
  9. Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
  10. ActivityId int `json:"activity_id" xorm:"not null comment('主活动id')" description:"主活动id"`
  11. ServerStartTime time.Time `json:"server_start_time" xorm:"not null comment('服务开始时间')" description:"服务开始时间"`
  12. ServerEndTime time.Time `json:"server_end_time" xorm:"not null comment('服务结束时间')" description:"服务结束时间"`
  13. ServerDisplay string `json:"server_display" xorm:"not null comment('霸屏展示的方式 [消息界面|互动界面]')" description:"霸屏展示的方式 [消息界面|互动界面]"`
  14. ServerStart string `json:"server_start" xorm:"not null comment('打赏服务是否开启 [开启|关闭]')" description:"打赏服务是否开启 [开启|关闭]"`
  15. IsExpire string `json:"is_expire" xorm:"not null comment('是否过期了 此字段应该由脚本去执行 当时间大于服务结束时间时 server_start为关闭 本字段未已过期')"`
  16. IsDelete bool `json:"-" xorm:"default(0)"`
  17. CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"`
  18. UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"`
  19. }
  20. func (t *RewardServer) TableName() string {
  21. return RewardServerTableName
  22. }
  23. func (t *RewardServer) GetByActivityId(aid int) (bool, error) {
  24. return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Get(t)
  25. }