Skip to content

Commit

Permalink
Merge pull request #41 from decert-me/fix/challenge-statistics
Browse files Browse the repository at this point in the history
Fix 过滤未启用挑战
  • Loading branch information
0xdwong authored Aug 6, 2024
2 parents 59f4163 + 3a1cf86 commit 4245100
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/internal/app/service/backend/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func GetChallengeStatistics(r request.GetChallengeStatisticsReq) (res []response
whereList = append(whereList, fmt.Sprintf("(users.address ILIKE ? OR users.name ILIKE ?)"))
valueList = append(valueList, "%"+r.SearchAddress+"%", "%"+r.SearchAddress+"%")
}
dataSQL += " WHERE quest.token_id is not null AND users.address is not null"
dataSQL += " WHERE quest.token_id is not null AND users.address is not null AND quest.disable = false"
if len(whereList) > 0 {
dataSQL += " AND " + strings.Join(whereList, " AND ")
}
Expand Down Expand Up @@ -202,6 +202,9 @@ func GetChallengeStatistics(r request.GetChallengeStatisticsReq) (res []response

for _, user := range userList {
for _, quest := range questList {
if quest.Disabled {
continue
}
if isAddressAndTokenIDInResults(user.Address, quest.TokenId, results) {
continue
}
Expand Down

0 comments on commit 4245100

Please sign in to comment.