|
|
@ -23,6 +23,7 @@ func (t *SignCtl) Sign() { |
|
|
|
uid := t.MustGetUID() |
|
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
|
customerId := t.MustGetInt64("customer_id") |
|
|
|
kind, _ := t.GetInt("kind") |
|
|
|
|
|
|
|
//根据activity_id查找主活动的信息
|
|
|
|
activity := new(models.Activity) |
|
|
@ -73,6 +74,7 @@ func (t *SignCtl) Sign() { |
|
|
|
} |
|
|
|
|
|
|
|
signHistory = new(models.SignHistory) |
|
|
|
signHistory.Type = kind |
|
|
|
signHistory.UserId = uid |
|
|
|
signHistory.RehearsalId = activity.RehearsalId |
|
|
|
signHistory.ActivityId = activityId |
|
|
@ -102,8 +104,13 @@ func (t *SignCtl) RealSign() { |
|
|
|
uid := t.MustGetUID() |
|
|
|
rid := t.MustGetInt64("rehearsal_id") |
|
|
|
|
|
|
|
user := new(models.User) |
|
|
|
exist, err := user.GetById(uid) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_USER_NOT_EXIST, "用户不存在") |
|
|
|
|
|
|
|
sign := new(models.SignUp) |
|
|
|
exist, err := sign.GetByActivityId(aid) |
|
|
|
exist, err = sign.GetByActivityId(aid) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_SIGN_UP_NOT_EXIST, "签到活动不存在") |
|
|
|
|
|
|
@ -132,7 +139,7 @@ func (t *SignCtl) RealSign() { |
|
|
|
|
|
|
|
history.ActivityId = aid |
|
|
|
history.UserId = uid |
|
|
|
history.Nickname = t.MustGetName() |
|
|
|
history.Nickname = user.Nickname |
|
|
|
history.RehearsalId = rid |
|
|
|
history.Content = string(body) |
|
|
|
if exist { // 存在 直接通过
|
|
|
|