|
|
@ -6,7 +6,6 @@ import ( |
|
|
|
"hudongzhuanjia/controllers" |
|
|
|
"hudongzhuanjia/models" |
|
|
|
"hudongzhuanjia/utils/code" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
type VoteCtl struct { |
|
|
@ -53,14 +52,11 @@ func (t *VoteCtl) Vote() { |
|
|
|
t.ERROR(fmt.Sprintf("您投票人数已超过%d人", vote.ModelNum), code.MSG_ERR) |
|
|
|
} |
|
|
|
} |
|
|
|
// done: 增加人数限制
|
|
|
|
history.UserId = uid |
|
|
|
history.RehearsalId = activity.RehearsalId |
|
|
|
history.VoteActivityId = vote.Id |
|
|
|
history.VoteActivityLadderId = ladderId |
|
|
|
history.IsDelete = false |
|
|
|
history.CreatedAt = time.Now() |
|
|
|
history.UpdatedAt = time.Now() |
|
|
|
history.ArchId = activity.ArchId |
|
|
|
_, err = models.Add(history) |
|
|
|
t.CheckErr(err) |
|
|
|
|
|
|
@ -81,7 +77,7 @@ func (t *VoteCtl) List() { |
|
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
|
t.CheckRunning(activity.Status) |
|
|
|
|
|
|
|
votes, err := models.GetVoteListByActivityId(activity.Id) |
|
|
|
votes, err := models.GetVoteListByActivityId(activity.Id, activity.ArchId) |
|
|
|
t.CheckErr(err) |
|
|
|
|
|
|
|
t.JSON(map[string]interface{}{ |
|
|
|