Skip to content

Commit

Permalink
Merge pull request #92 from sotatek-dev/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sotatek-TanHoang authored Sep 26, 2024
2 parents c22d42e + ead7873 commit 0d1613b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/database/repositories/common-configuration.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { CommonConfig } from '../../modules/crawler/entities/common-config.entit
export class CommonConfigRepository extends BaseRepository<CommonConfig> {
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)
Expand Down
4 changes: 3 additions & 1 deletion src/database/repositories/event-log.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export class EventLogRepository extends BaseRepository<EventLog> {
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`,
Expand Down

0 comments on commit 0d1613b

Please sign in to comment.