|
|
@ -13,10 +13,11 @@ type PadSignCtl struct { |
|
|
|
|
|
|
|
func (t *PadSignCtl) Setting() { |
|
|
|
activityId := t.MustGetInt("activity_id") |
|
|
|
rehearsalId := t.MustGetInt("rehearsal_id") |
|
|
|
|
|
|
|
// 平板签约信息
|
|
|
|
padSigning := &models.PadSigning{} |
|
|
|
exist, err := padSigning.GetByActivityId(activityId) |
|
|
|
exist, err := padSigning.GetByActivityId(activityId, rehearsalId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_PAD_SIGNING_NOT_EXIST, "平板签约信息异常") |
|
|
|
|
|
|
@ -31,6 +32,7 @@ func (t *PadSignCtl) Setting() { |
|
|
|
|
|
|
|
func (t *PadSignCtl) Switch() { |
|
|
|
activityId := t.MustGetInt("activity_id") |
|
|
|
rehearsalId := t.MustGetInt("rehearsal_id") |
|
|
|
status := t.MustGet("status") |
|
|
|
if status != define.StatusOpen && status != define.StatusClose { |
|
|
|
t.DisplayByError("status值为开启或关闭", code.MSG_ERR_Param) |
|
|
@ -38,12 +40,12 @@ func (t *PadSignCtl) Switch() { |
|
|
|
} |
|
|
|
|
|
|
|
padSigning := &models.PadSigning{} |
|
|
|
exist, err := padSigning.GetByActivityId(activityId) |
|
|
|
exist, err := padSigning.GetByActivityId(activityId, rehearsalId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_PAD_SIGNING_NOT_EXIST, "平板签约信息异常") |
|
|
|
|
|
|
|
padSigning.PadSignStatus = status |
|
|
|
_, err = padSigning.Update(padSigning, padSigning.Id, "status") |
|
|
|
_, err = padSigning.Update(padSigning, padSigning.Id, "pad_sign_status") |
|
|
|
t.CheckErr(err) |
|
|
|
t.DisplayBySuccess("已" + status) |
|
|
|
} |