From 703a5f4c5b25304df9bdb96b7dbe5471189bcde3 Mon Sep 17 00:00:00 2001 From: Abdul Rahman Reza Date: Thu, 5 Dec 2024 16:25:11 +0900 Subject: [PATCH] update having --- src/controllers/user_activity.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/user_activity.ts b/src/controllers/user_activity.ts index f0e4d11..580fec1 100644 --- a/src/controllers/user_activity.ts +++ b/src/controllers/user_activity.ts @@ -96,10 +96,10 @@ export class UserActivityController { } const res_count = userRepository.createQueryBuilder() - .where(whereAttr, whereVal); + .having(whereAttr, whereVal); const res_list = userRepository.createQueryBuilder() .addSelect('(SELECT u.username FROM users u WHERE u.id = id_user)', 'username') - .where(whereAttr, whereVal) + .having(whereAttr, whereVal) .orderBy(param.order_field, param.order_direction) .offset(offset) .limit(param.limit);