mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #65,5
This commit is contained in:
@@ -404,13 +404,13 @@ func (pcr *PollControllerRefactored) GetPollResults(c *gin.Context) {
|
||||
for _, option := range poll.Options {
|
||||
var count int64
|
||||
pcr.DB.Model(&models.PollVote{}).Where("option_id = ?", option.ID).Count(&count)
|
||||
|
||||
|
||||
results = append(results, OptionResult{
|
||||
OptionID: option.ID,
|
||||
OptionText: option.Text,
|
||||
VoteCount: count,
|
||||
})
|
||||
|
||||
|
||||
totalVotes += count
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user