Browse Source

fix:bug

token_replace
黄梓健 5 years ago
parent
commit
7dbf87949a
  1. 8
      controllers/client/vote.go

8
controllers/client/vote.go

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

Loading…
Cancel
Save