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.2 KiB
33 lines
1.2 KiB
package models
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/ouxuanserver/osmanthuswine/src/core"
|
|
"time"
|
|
)
|
|
|
|
const RealSignListTN = TableNamePrefix + "real_sign_list"
|
|
|
|
type RealSignList struct {
|
|
Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"`
|
|
ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('主活动id') INT(11)"`
|
|
JsonList string `json:"json_list" xorm:"not null comment('名单记录') TEXT"`
|
|
IsDelete bool `json:"is_delete" xorm:"default(0)" description:"是否删除"`
|
|
CreatedAt time.Time `json:"created_at" xorm:"created" description:"创建时间"`
|
|
UpdatedAt time.Time `json:"updated_at" xorm:"updated" description:"更新时间"`
|
|
}
|
|
|
|
func (t *RealSignList) TableName() string {
|
|
return RealSignListTN
|
|
}
|
|
|
|
//func (t *RealSignList) CheckSignIn(uid int64, aid int64) (bool, error) {
|
|
// exist, err := core.GetXormAuto().Where("is_delete=0 and user_id=? and activity_id=?", uid, aid).Exist(t)
|
|
// return exist, errors.WithStack(err)
|
|
//}
|
|
|
|
// 可能使用模糊匹配
|
|
func (t *RealSignList) CheckSignIn(aid int64, ext string) (bool, error) {
|
|
var sql = fmt.Sprintf("is_delete=0 and activity_id=%d %s", aid, ext)
|
|
return core.GetXormAuto().Where(sql).Get(t)
|
|
}
|