Fix Statistics: count each time log once in the members widget

Merged
ND
4d ago
+30-18

Fixes #11210

The Members widget ranking and weekly bars counted each time log once per 10 minute slot, because the queries joined the logs to their time slots before summing. Both ORM branches now check the slots with an EXISTS sub-query, so each log is summed once. The response shape, the ordering, the filters and the week and today durations stay as they were.


Summary by cubic

Fixes #11210

The members ranking and weekly hours bars counted each time log once per 10-minute slot, because the queries joined the logs to their time slots before summing. Both ORM branches (knex and TypeORM) now check the slots with an EXISTS sub-query, so each log is summed once. The response shape, ordering, filters, and week and today durations stay the same.