Typeorm Selecione JONE COLUNS QueryBuilder
this.createQueryBuilder('profile')
.leftJoinAndSelect('profile.avatarPhoto', 'avatarPhoto')
.leftJoinAndSelect('profile.coverPhoto', 'coverPhoto')
.leftJoinAndSelect('profile.primaryCountry', 'country')
.leftJoinAndSelect('profile.primaryCity', 'city')
.leftJoinAndSelect('profile.images', 'image')
.leftJoinAndSelect('profile.practicedSports', 'practicedSport')
.leftJoinAndSelect(
(subQuery) =>
subQuery
.subQuery()
.createQueryBuilder()
.select(['id'])
.leftJoin('user', 'user')
.from(SportEvent, 'event'),
'event',
'event.user.id = profile.id',
)
// .leftJoinAndSelect('profile.sportServices', 'service')
// .leftJoinAndSelect('profile.lessons', 'lesson')
// .leftJoinAndSelect('profile.activityRequests', 'request')
.leftJoin('profile.userAuth', 'auth')
.where('auth.registered = true')
.andWhere('auth.blocked = false')
.take(params.pageSize)
.skip(itemsNumber)
.getMany()
Restu Wahyu Saputra