add role parent
This commit is contained in:
parent
072d9a6880
commit
bd9c270cd7
9 changed files with 231 additions and 241 deletions
|
|
@ -75,19 +75,16 @@ export class ProfileEditController extends Controller {
|
|||
);
|
||||
}),
|
||||
)
|
||||
.orderBy("ProfileEdit.createdAt", "DESC")
|
||||
.orderBy("ProfileEdit.createdAt", "DESC");
|
||||
|
||||
if (sortBy) {
|
||||
query = query.orderBy(
|
||||
`ProfileEdit.${sortBy}`,
|
||||
descending ? "DESC" : "ASC"
|
||||
);
|
||||
query = query.orderBy(`ProfileEdit.${sortBy}`, descending ? "DESC" : "ASC");
|
||||
}
|
||||
|
||||
const [getProfileEdit, total] = await query
|
||||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
.getManyAndCount();
|
||||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
.getManyAndCount();
|
||||
|
||||
const _data = getProfileEdit.map((item) => ({
|
||||
id: item.id,
|
||||
|
|
@ -153,7 +150,7 @@ export class ProfileEditController extends Controller {
|
|||
data.child1 != undefined && data.child1 != null
|
||||
? data.child1[0] != null
|
||||
? `current_holders.orgChild1Id IN (:...child1)`
|
||||
: `current_holders.orgChild1Id is null`
|
||||
: `current_holders.orgChild1Id is ${data.privilege == "PARENT" ? "not null" : "null"}`
|
||||
: "1=1",
|
||||
{
|
||||
child1: data.child1,
|
||||
|
|
@ -216,26 +213,20 @@ export class ProfileEditController extends Controller {
|
|||
);
|
||||
}),
|
||||
)
|
||||
.orderBy("ProfileEdit.createdAt", "DESC")
|
||||
|
||||
.orderBy("ProfileEdit.createdAt", "DESC");
|
||||
|
||||
if (sortBy) {
|
||||
if(sortBy == "fullname"){
|
||||
query = query.orderBy(
|
||||
`profile.firstName`,
|
||||
descending ? "DESC" : "ASC"
|
||||
);
|
||||
}else{
|
||||
query = query.orderBy(
|
||||
`ProfileEdit.${sortBy}`,
|
||||
descending ? "DESC" : "ASC"
|
||||
);
|
||||
if (sortBy == "fullname") {
|
||||
query = query.orderBy(`profile.firstName`, descending ? "DESC" : "ASC");
|
||||
} else {
|
||||
query = query.orderBy(`ProfileEdit.${sortBy}`, descending ? "DESC" : "ASC");
|
||||
}
|
||||
}
|
||||
|
||||
const [getProfileEdit, total] = await query
|
||||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
.getManyAndCount();
|
||||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
.getManyAndCount();
|
||||
|
||||
const _data = getProfileEdit.map((item) => ({
|
||||
id: item.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue