|
|
@ -14,17 +14,18 @@ type SignHistory struct { |
|
|
|
//CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"`
|
|
|
|
//UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME"`
|
|
|
|
|
|
|
|
AreaId int `json:"area_id" xorm:"not null default 0 comment('地区id') INT(11)"` |
|
|
|
ArchId int `json:"arch_id" xorm:"not null default 0 comment('归档id') INT(11)"` |
|
|
|
ActivityId int `json:"activity_id" xorm:"not null default 0 comment('主活动id') INT(11)"` |
|
|
|
RehearsalId int `json:"rehearsal_id" xorm:"not null default 0 comment('彩排id/ 0正式') INT(11)"` |
|
|
|
SignRuleId int `json:"sign_rule_id" xorm:"not null default 0 comment('sign_up表id') INT(11)"` |
|
|
|
Type int `json:"type" xorm:"not null default 0 comment('普通签到') TINYINT(1)"` |
|
|
|
UserId int `json:"user_id" xorm:"not null default 0 comment('用户表id') TINYINT(11)"` |
|
|
|
SignMethod int `json:"sign_method" xorm:"not null default 0 comment('1扫码签到2实名签到3人脸签到') TINYINT(1)"` |
|
|
|
Content string `json:"content" xorm:"json comment('提交审核的内容') TEXT"` |
|
|
|
Nickname string `json:"nickname" xorm:"not null default('') comment('微信昵称') VARCHAR(128)"` |
|
|
|
Status int `json:"status" xorm:"not null default 0 comment('是否通过审核[0未通过审核1申请审核2通过审核]') TINYINT(1)"` |
|
|
|
AreaId int `json:"area_id" xorm:"not null default 0 comment('地区id') INT(11)"` |
|
|
|
ArchId int `json:"arch_id" xorm:"not null default 0 comment('归档id') INT(11)"` |
|
|
|
ActivityId int `json:"activity_id" xorm:"not null default 0 comment('主活动id') INT(11)"` |
|
|
|
RehearsalId int `json:"rehearsal_id" xorm:"not null default 0 comment('彩排id/ 0正式') INT(11)"` |
|
|
|
SignRuleId int `json:"sign_rule_id" xorm:"not null default 0 comment('sign_up表id') INT(11)"` |
|
|
|
RealSignListId int `json:"real_sign_list_id" xorm:"not null default 0 comment('实名签到认证信息ID') INT(11)"` |
|
|
|
// Type int `json:"type" xorm:"not null default 0 comment('普通签到') TINYINT(1)"`
|
|
|
|
UserId int `json:"user_id" xorm:"not null default 0 comment('用户表id') TINYINT(11)"` |
|
|
|
SignMethod int `json:"sign_method" xorm:"not null default 0 comment('1扫码签到2实名签到3人脸签到') TINYINT(1)"` |
|
|
|
Content string `json:"content" xorm:"json comment('提交审核的内容') TEXT"` |
|
|
|
Nickname string `json:"nickname" xorm:"not null default('') comment('微信昵称') VARCHAR(128)"` |
|
|
|
Status int `json:"status" xorm:"not null default 0 comment('是否通过审核[0未通过审核1申请审核2通过审核]') TINYINT(1)"` |
|
|
|
} |
|
|
|
|
|
|
|
func (t *SignHistory) TableName() string { |
|
|
@ -36,11 +37,9 @@ func (t *SignHistory) GetByUserId(activityId, archId, userId, rehearsalId, areaI |
|
|
|
"rehearsal_id=? and area_id=?", activityId, archId, userId, rehearsalId, areaId).Get(t) |
|
|
|
} |
|
|
|
|
|
|
|
func (t *SignHistory) Count(signUpId, activityId, archId, rehearsalId, status interface{}) (int64, error) { |
|
|
|
// 签到人数
|
|
|
|
return core.GetXormAuto().Where("is_delete=0 and sign_rule_id=? and "+ |
|
|
|
" activity_id=? and arch_id=? and rehearsal_id=? and status=?", |
|
|
|
signUpId, activityId, archId, rehearsalId, status).Count(t) |
|
|
|
func (t *SignHistory) Count(activityId, archId, rehearsalId, status interface{}) (int64, error) { |
|
|
|
return core.GetXormAuto().Where("is_delete=0 and activity_id=? and arch_id=? and "+ |
|
|
|
" rehearsal_id=? and status=?", activityId, archId, rehearsalId, status).Count(t) |
|
|
|
} |
|
|
|
|
|
|
|
func (t *SignHistory) UpdateByIds(ids interface{}, fields ...string) (err error) { |
|
|
@ -75,3 +74,8 @@ func GetSignHistories(activityId, rehearsalId, archId, page, size int) (total in |
|
|
|
total, err = session.FindAndCount(&result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func ExistReviewedSignInfo(activityId, archId, rehearsalId, realSignListId interface{}) (bool, error) { |
|
|
|
return core.GetXormAuto().Where("is_delete=0 and activity_id=? and arch_id=? and rehearsal_id=? and "+ |
|
|
|
" real_sign_list_id=? and status=2", activityId, archId, rehearsalId, realSignListId).Exist(&SignHistory{}) |
|
|
|
} |