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

25 lines
1.5 KiB

5 years ago
  1. package models
  2. import (
  3. "time"
  4. "github.com/ouxuanserver/osmanthuswine/src/core"
  5. )
  6. type Invitation struct {
  7. Id int64 `json:"id" description:"主键"`
  8. ActivityId int64 `json:"activity_id" xorm:"not null comment('主活动id')" description:"主活动id"`
  9. SettingBox string `json:"setting_box" xorm:"not null comment('表单选项json化')" description:"表单选项Json化"`
  10. SelfBox string `json:"self_box" xorm:"not null comment('表单选项json化')" description:"自定义表单选项json"`
  11. SubmitTimeLimit time.Time `json:"submit_time_limit" xorm:"not null comment('0为不限制 1为限制 限制必填时间段')" description:"0为不限制 1为限制 限制必填时间段"`
  12. TimeLimitEnd time.Time `json:"time_limit_end" xorm:"not null default('1970-01-01 08:00:00') comment('限制时间段结束')" description:"限制时间段结束"`
  13. QrImageUrl string `json:"qr_image_url" xorm:"not null comment('二维码图片地址')" description:"二维码图片地址"`
  14. QrDestUrl string `json:"qr_dest_url" xorm:"not null comment('二维码图片指向地址')" description:"二维码图片指向地址"`
  15. IsDelete bool `json:"-" xorm:"default(0)" description:"删除"`
  16. CreatedAt time.Time `json:"-" xorm:"created"`
  17. UpdatedAt time.Time `json:"-" xorm:"updated"`
  18. }
  19. func (i *Invitation) GetInvitationByActivityId(aid int64) (bool, error) {
  20. return core.GetXormAuto().Where("activity_id = ? and is_delete = ?", aid, false).Get(i)
  21. }