udpateg
This commit is contained in:
@ -83,14 +83,29 @@ export class UserController {
|
|||||||
|
|
||||||
const res_count = userRepository.createQueryBuilder()
|
const res_count = userRepository.createQueryBuilder()
|
||||||
.where(whereAttr, whereVal);
|
.where(whereAttr, whereVal);
|
||||||
const res_list = userRepository.createQueryBuilder()
|
|
||||||
|
const subquery = userRepository
|
||||||
|
.createQueryBuilder()
|
||||||
|
.select("User.id")
|
||||||
.where(whereAttr, whereVal)
|
.where(whereAttr, whereVal)
|
||||||
.leftJoinAndSelect("User.roles", "roles")
|
|
||||||
.leftJoinAndSelect("roles.application", "application")
|
|
||||||
.orderBy(param.order_field, param.order_direction)
|
.orderBy(param.order_field, param.order_direction)
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
.limit(param.limit);
|
.limit(param.limit);
|
||||||
|
|
||||||
|
const res_list = userRepository
|
||||||
|
.createQueryBuilder()
|
||||||
|
.where(`User.id IN (${subquery.getQuery()})`)
|
||||||
|
.leftJoinAndSelect("User.roles", "roles")
|
||||||
|
.leftJoinAndSelect("roles.application", "application");
|
||||||
|
|
||||||
|
// const res_list = userRepository.createQueryBuilder()
|
||||||
|
// .where(whereAttr, whereVal)
|
||||||
|
// .leftJoinAndSelect("User.roles", "roles")
|
||||||
|
// .leftJoinAndSelect("roles.application", "application")
|
||||||
|
// .orderBy(param.order_field, param.order_direction)
|
||||||
|
// .offset(offset)
|
||||||
|
// .limit(param.limit);
|
||||||
|
|
||||||
if (param.with_deleted) {
|
if (param.with_deleted) {
|
||||||
res_count.withDeleted();
|
res_count.withDeleted();
|
||||||
res_list.withDeleted();
|
res_list.withDeleted();
|
||||||
|
|||||||
Reference in New Issue
Block a user