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

30 lines
1.7 KiB

5 years ago
5 years ago
5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const LiveConfigAreaTN = TableNamePrefix + "live_config_area"
  7. type LiveConfigArea struct {
  8. Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"`
  9. IsDelete bool `json:"-" xorm:"not null default 0 comment('是否删除') TINYINT(1)"`
  10. CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"`
  11. UpdatedAt time.Time `json:"updated_at" xorm:"not null updated default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"`
  12. ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"`
  13. AreaId int64 `json:"area_id" xorm:"not null default 0 comment('地区id') INT(11)"`
  14. LiveH5Url string `json:"live_h5_url" xorm:"not null default '' comment('h5直播地址') VARCHAR(255)"`
  15. LiveH5Qrcode string `json:"live_h5_qrcode" xorm:"not null default '' comment('h5直播地址二维码') VARCHAR(255)"`
  16. AdminLiveUrl string `json:"admin_live_url" xorm:"not null default '' comment('管理员直播地址,即直播页面中管理员登录页面') VARCHAR(255)"`
  17. LiveH5AdminQrcode string `json:"live_h5_admin_qrcode" xorm:"not null default '' comment('管理员直播地址二维码') VARCHAR(255)"`
  18. MergeSharePoster string `json:"merge_share_poster" xorm:"not null default '' comment('合成有二维码的海报') VARCHAR(255)"`
  19. }
  20. func (t *LiveConfigArea) TableName() string {
  21. return LiveConfigAreaTN
  22. }
  23. func (t *LiveConfigArea) GetByActivityIdAndAreaId(activityId, areaId interface{}) (bool, error) {
  24. return core.GetXormAuto().Where("is_delete=0 and activity_id=? and area_id=?", activityId, areaId).Get(t)
  25. }