Browse Source

real sign

master
黄梓健 5 years ago
parent
commit
d8cb5a6eaf
  1. 20
      controllers/client/sign.go

20
controllers/client/sign.go

@ -284,3 +284,23 @@ func (t *SignCtl) ApplySign() {
t.CheckErr(err) t.CheckErr(err)
t.SUCCESS("申请成功") t.SUCCESS("申请成功")
} }
func (t *SignCtl) CheckRealSign() {
userId := t.MustGetUID()
areaId := t.MustGetInt64("area_id")
activityId := t.MustGetInt64("activity_id")
activity := new(models.Activity)
exist, err := models.Get(activity, activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在")
history := new(models.SignHistory)
exist, err = history.GetByUserId(activityId, userId, activity.RehearsalId, areaId)
t.CheckErr(err)
t.Assert(exist, code.MSG_SIGN_HISTORY_NOT_EXIST, "签到信息不存在")
if history.Status == 2 {
t.SUCCESS("签到成功")
}
t.ERROR("签到尚未审核", code.MSG_SIGN_HISTORY_NOT_EXIST)
}
Loading…
Cancel
Save