From d8cb5a6eafb9a9b4d9c41223bb652a2c166025ed Mon Sep 17 00:00:00 2001 From: tommy <3405129587@qq.com> Date: Mon, 8 Jun 2020 18:33:28 +0800 Subject: [PATCH] real sign --- controllers/client/sign.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/controllers/client/sign.go b/controllers/client/sign.go index 20bf7ac..221d6f2 100644 --- a/controllers/client/sign.go +++ b/controllers/client/sign.go @@ -284,3 +284,23 @@ func (t *SignCtl) ApplySign() { t.CheckErr(err) 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) +}