rez_core 2.2.104 → 2.2.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -69,7 +69,7 @@ export class SchoolRepository {
|
|
|
69
69
|
|
|
70
70
|
'school.id AS school_id',
|
|
71
71
|
'school.name AS school_name',
|
|
72
|
-
'
|
|
72
|
+
'address.area AS school_location',
|
|
73
73
|
'school.status AS school_status',
|
|
74
74
|
])
|
|
75
75
|
.from('cr_organization', 'org')
|
|
@@ -80,9 +80,9 @@ export class SchoolRepository {
|
|
|
80
80
|
'brand_profile.parent_id = brn.id AND brand_profile.organization_id = org.id',
|
|
81
81
|
)
|
|
82
82
|
.innerJoin('eth_school_profile', 'school', 'school.brand_id = brn.id')
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
.innerJoin('eth_address', 'address', 'address.parent_id = school.id')
|
|
84
|
+
.where('org.id = :orgId', { orgId: currentORGLevel_id })
|
|
85
|
+
.distinct(true)
|
|
86
86
|
.getRawMany();
|
|
87
87
|
|
|
88
88
|
if (schools.length > 0) {
|
|
@@ -200,15 +200,17 @@ export class SchoolRepository {
|
|
|
200
200
|
'brand.status AS brand_status',
|
|
201
201
|
'school.id AS school_id',
|
|
202
202
|
'school.name AS school_name',
|
|
203
|
-
'
|
|
203
|
+
'address.area AS school_location',
|
|
204
204
|
'school.status AS school_status',
|
|
205
205
|
])
|
|
206
206
|
.from('cr_user_role_mapping', 'urm')
|
|
207
207
|
.innerJoin('cr_organization', 'brand', 'brand.id = urm.level_id')
|
|
208
208
|
.innerJoin('eth_school_profile', 'school', 'school.brand_id = brand.id')
|
|
209
|
+
.innerJoin('eth_address', 'address', 'address.parent_id = school.id')
|
|
209
210
|
.where('urm.user_id = :userId', { userId })
|
|
210
211
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
211
212
|
.andWhere('urm.level_type = :levelType', { levelType: 'BRN' })
|
|
213
|
+
.distinct(true)
|
|
212
214
|
.getRawMany();
|
|
213
215
|
|
|
214
216
|
const schMappings = await this.dataSource
|
|
@@ -219,15 +221,17 @@ export class SchoolRepository {
|
|
|
219
221
|
'brand.status AS brand_status',
|
|
220
222
|
'school.id AS school_id',
|
|
221
223
|
'school.name AS school_name',
|
|
222
|
-
'
|
|
224
|
+
'address.area AS school_location',
|
|
223
225
|
'school.status AS school_status',
|
|
224
226
|
])
|
|
225
227
|
.from('cr_user_role_mapping', 'urm')
|
|
226
228
|
.innerJoin('eth_school_profile', 'school', 'school.id = urm.level_id')
|
|
227
229
|
.innerJoin('cr_organization', 'brand', 'brand.id = school.brand_id')
|
|
230
|
+
.innerJoin('eth_address', 'address', 'address.parent_id = school.id')
|
|
228
231
|
.where('urm.user_id = :userId', { userId })
|
|
229
232
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
230
233
|
.andWhere('urm.level_type = :levelType', { levelType: 'SCH' })
|
|
234
|
+
.distinct(true) // avoids duplicates from duplicate addresses
|
|
231
235
|
.getRawMany();
|
|
232
236
|
|
|
233
237
|
const allMappings = [...brnMappings, ...schMappings];
|