Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/donations: Fix wrong unique donors count
Currently when we count unique donors we group them by billing_name, which gives us the total number of unique donors. The number of total donors is then added, to the total amount of donations made by the first user in the returned query. This results in overestimating the actually count of unique donors. Changed the query to plain SQL, as prisma doesn't yet support counting by distinct properties, and counting is relatively faster to process, than grouping or searching Changed the query to count by distinct billing_email property, rather than billing_name, as email is the "more unique" property of the two.
- Loading branch information