typeorm select join column querybuilder typeorm select join column querybuilder

The solution for “typeorm select join column querybuilder typeorm select join column querybuilder” can be found here. The following code will assist you in solving the problem.

let query: SelectQueryBuilder = this.projectModel
.createQueryBuilder(‘projects’)
.select([
‘projects’,
‘customers.id’,
‘customers.email’,
‘customers.phone’,
‘customers.is_verified’,
‘customers.created_at’,
‘property_types’,
‘project_executives’,
‘interior_design_partners’,
‘mitra_produksi_partners’
])
.where({ deleted_at: null })
.leftJoin(‘projects.customers’, ‘customers’)
.leftJoin(‘projects.property_types’, ‘property_types’)
.leftJoin(‘projects.project_executive’, ‘project_executives’)
.leftJoin(‘projects.interior_design_partner’, ‘interior_design_partners’)
.leftJoin(‘projects.mitra_produksi_partner’, ‘mitra_produksi_partners’)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()

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in