From eeb17409a1d1bb7470757ba439409029ee8bc38d Mon Sep 17 00:00:00 2001 From: Tan Hoang Date: Thu, 26 Sep 2024 09:41:55 +0700 Subject: [PATCH] fix: history user --- src/database/repositories/common-configuration.repository.ts | 4 ++-- src/database/repositories/event-log.repository.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/database/repositories/common-configuration.repository.ts b/src/database/repositories/common-configuration.repository.ts index 7c1efec..6ea6d79 100644 --- a/src/database/repositories/common-configuration.repository.ts +++ b/src/database/repositories/common-configuration.repository.ts @@ -8,13 +8,13 @@ import { CommonConfig } from '../../modules/crawler/entities/common-config.entit export class CommonConfigRepository extends BaseRepository { protected alias: ETableName = ETableName.COMMON_CONFIGURATION; - public async getCommonConfig() { + public getCommonConfig() { return this.createQueryBuilder(`${this.alias}`) .select([`${this.alias}.id`, `${this.alias}.tip`, `${this.alias}.dailyQuota`, `${this.alias}.asset`]) .getOne(); } - public async updateCommonConfig(id: number, updateConfig) { + public updateCommonConfig(id: number, updateConfig) { return this.createQueryBuilder(`${this.alias}`) .update(CommonConfig) .set(updateConfig) diff --git a/src/database/repositories/event-log.repository.ts b/src/database/repositories/event-log.repository.ts index 8fcb433..795e1dd 100644 --- a/src/database/repositories/event-log.repository.ts +++ b/src/database/repositories/event-log.repository.ts @@ -72,7 +72,9 @@ export class EventLogRepository extends BaseRepository { public async getHistoriesOfUser(address: string, options) { const queryBuilder = this.createQb(); queryBuilder - .where(`${this.alias}.sender_address = :address OR ${this.alias}.receive_address = :address`, { address }) + .where(`LOWER(${this.alias}.sender_address) = :address OR LOWER(${this.alias}.receive_address) = :address`, { + address: address.toLowerCase(), + }) .orderBy(`${this.alias}.id`, EDirection.DESC) .select([ `${this.alias}.id`,