From 9bf4080d67d6342624c8f1fb543acab00191f730 Mon Sep 17 00:00:00 2001 From: Ran Guin Date: Mon, 5 Jul 2021 15:29:37 -0700 Subject: generate distinct counts for payment types --- routes/admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/admin.js b/routes/admin.js index a2d07178..a2055c7c 100644 --- a/routes/admin.js +++ b/routes/admin.js @@ -207,7 +207,7 @@ router.get( transactions = transactions .select( - knex.raw('COUNT(' + types[i] + '.id) as ' + types[i]), + knex.raw('COUNT(DISTINCT ' + types[i] + '.id) as ' + types[i]), knex.raw('LEFT(MAX(' + types[i] + '.updatedAt), 10) as ' + stamp) ) .leftJoin(types[i], 'users.id', types[i] + '.user_id') -- cgit v1.2.3