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

33 lines
1.3 KiB

package models
import (
"github.com/ouxuanserver/osmanthuswine/src/core"
)
const RealSignListTN = TableNamePrefix + "real_sign_list"
type RealSignList struct {
Model `xorm:"extends"`
//Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
//IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('是否删除') TINYINT(1)"`
//CreatedAt time.Time `json:"created_at" xorm:"created comment('创建时间') TIMESTAMP"`
//UpdatedAt time.Time `json:"updated_at" xorm:"updated comment('更新时间') TIMESTAMP"`
ActivityId int `json:"activity_id" xorm:"not null default 0 comment('主活动id') INT(11)"`
JsonList string `json:"json_list" xorm:"not null comment('名单记录') TEXT"`
//Status int `json:"status" xorm:"not null default 0 comment('是否已被验证[0/1]') TINYINT(1)"` // 废弃字段
}
func (t *RealSignList) TableName() string {
return RealSignListTN
}
// 可能使用模糊匹配
func (t *RealSignList) CheckSignIn(aid int, ext string) (bool, error) {
ext += " 1 = 1 "
return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Where(ext).Get(t)
}
func (t *RealSignList) Count(activityId int) (int64, error) {
return core.GetXormAuto().Where("is_delete=0 and activity_id=?", activityId).Count(t)
}