Skip to content

Commit

Permalink
tested unique paid hunters
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Feb 8, 2024
1 parent 205ea9c commit a09aa6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ func (db database) TotalPaidBounties(r PaymentDateRange) int64 {

func (db database) TotalHuntersPaid(r PaymentDateRange) int64 {
var count int64
db.db.Model(&Bounty{}).Select("DISTINCT assignee").Where("assignee != ''").Where("paid = ?", true).Where("created >= ?", r.StartDate).Where("created <= ?", r.EndDate).Count(&count)
query := fmt.Sprintf(`SELECT COUNT(DISTINCT assignee) FROM bounty WHERE assignee !='' AND paid=true AND created >= %s AND created <= %s`, r.StartDate, r.EndDate)

db.db.Raw(query).Count(&count)
return count
}

Expand Down

0 comments on commit a09aa6f

Please sign in to comment.