Skip to content

Commit

Permalink
Fix where condition in lateral query
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed Nov 10, 2022
1 parent 61ccced commit e24f304
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/uni-info-watcher/src/custom-indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class CustomIndexer {
}

let selectQueryBuilder = latestEntityRepo.createQueryBuilder('latest')
.select('result.*')
.select('*')
.from(
qb => {
// https://stackoverflow.com/a/72026555/10026807
Expand All @@ -195,13 +195,13 @@ export class CustomIndexer {
'result'
);

selectQueryBuilder = this.buildQuery(entityRepo, selectQueryBuilder, where, 'result', 'subTable_');
selectQueryBuilder = this.buildQuery(latestEntityRepo, selectQueryBuilder, where, 'latest');

if (queryOptions.orderBy) {
selectQueryBuilder = this.orderQuery(entityRepo, selectQueryBuilder, queryOptions, 'result', 'subTable_');
selectQueryBuilder = this.orderQuery(latestEntityRepo, selectQueryBuilder, queryOptions, 'latest');
}

selectQueryBuilder = this.orderQuery(entityRepo, selectQueryBuilder, { ...queryOptions, orderBy: 'id' }, 'result', 'subTable_');
selectQueryBuilder = this.orderQuery(latestEntityRepo, selectQueryBuilder, { ...queryOptions, orderBy: 'id' }, 'latest');

if (queryOptions.skip) {
selectQueryBuilder = selectQueryBuilder.offset(queryOptions.skip);
Expand Down

0 comments on commit e24f304

Please sign in to comment.