Browse Source

fix:bug

master
黄梓健 5 years ago
parent
commit
0a9d801550
  1. 7
      controllers/client/sign.go
  2. 2
      models/real_sign_list.go

7
controllers/client/sign.go

@ -254,8 +254,13 @@ func (t *SignCtl) RealSign() {
return return
} }
exist, err = new(models.RealSignList).CheckSignIn(activityId, extSql)
realSignList := new(models.RealSignList)
exist, err = realSignList.CheckSignIn(activityId, extSql)
t.CheckErr(err) t.CheckErr(err)
if exist && realSignList.Status == 1 {
t.ERROR("实名签到名单已被认证", code.MSG_SIGN_REAL_NOT_EXIST)
return
}
var body []byte var body []byte
body, err = json.Marshal(params) body, err = json.Marshal(params)

2
models/real_sign_list.go

@ -15,6 +15,7 @@ type RealSignList struct {
ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('主活动id') 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"` JsonList string `json:"json_list" xorm:"not null comment('名单记录') TEXT"`
Status int `json:"status" xorm:"not null comment('是否已被验证[0/1]') TINYINT(1)"`
} }
func (t *RealSignList) TableName() string { func (t *RealSignList) TableName() string {
@ -23,7 +24,6 @@ func (t *RealSignList) TableName() string {
// 可能使用模糊匹配 // 可能使用模糊匹配
func (t *RealSignList) CheckSignIn(aid int64, ext string) (bool, error) { func (t *RealSignList) CheckSignIn(aid int64, ext string) (bool, error) {
//var sql = fmt.Sprintf("is_delete=0 and activity_id=%d and ", aid, ext)
ext += " 1 = 1 " ext += " 1 = 1 "
return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Where(ext).Get(t) return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Where(ext).Get(t)
} }
Loading…
Cancel
Save