add permission brother
This commit is contained in:
parent
12957bb366
commit
d8d2794e3c
2 changed files with 60 additions and 46 deletions
|
|
@ -174,7 +174,7 @@ export class EvaluationController {
|
|||
_data.child1 != undefined && _data.child1 != null
|
||||
? _data.child1[0] != null
|
||||
? `evaluation.child1DnaId IN (:...child1)`
|
||||
: `evaluation.child1DnaId is null`
|
||||
: `evaluation.child1DnaId is ${_data.privilege == "PARENT" ? "not null" : "null"}`
|
||||
: "1=1",
|
||||
{
|
||||
child1: _data.child1,
|
||||
|
|
@ -234,15 +234,12 @@ export class EvaluationController {
|
|||
}),
|
||||
);
|
||||
}),
|
||||
)
|
||||
);
|
||||
|
||||
if (body.sortBy) {
|
||||
query = query.orderBy(
|
||||
`evaluation.${body.sortBy}`,
|
||||
body.descending ? "DESC" : "ASC"
|
||||
);
|
||||
}else{
|
||||
query = query.orderBy("evaluation.lastUpdatedAt", "DESC")
|
||||
query = query.orderBy(`evaluation.${body.sortBy}`, body.descending ? "DESC" : "ASC");
|
||||
} else {
|
||||
query = query.orderBy("evaluation.lastUpdatedAt", "DESC");
|
||||
}
|
||||
|
||||
const [evaluation, total] = await query
|
||||
|
|
@ -281,8 +278,8 @@ export class EvaluationController {
|
|||
pageSize: number;
|
||||
keyword?: string;
|
||||
status?: string[];
|
||||
sortBy?: string,
|
||||
descending?: boolean,
|
||||
sortBy?: string;
|
||||
descending?: boolean;
|
||||
},
|
||||
) {
|
||||
try {
|
||||
|
|
@ -306,13 +303,10 @@ export class EvaluationController {
|
|||
});
|
||||
}),
|
||||
)
|
||||
.orderBy("evaluation.lastUpdatedAt", "DESC")
|
||||
.orderBy("evaluation.lastUpdatedAt", "DESC");
|
||||
|
||||
if (body.sortBy) {
|
||||
query = query.orderBy(
|
||||
`evaluation.${body.sortBy}`,
|
||||
body.descending ? "DESC" : "ASC"
|
||||
);
|
||||
query = query.orderBy(`evaluation.${body.sortBy}`, body.descending ? "DESC" : "ASC");
|
||||
}
|
||||
|
||||
const [evaluation, total] = await query
|
||||
|
|
@ -3125,7 +3119,9 @@ export class EvaluationController {
|
|||
evaluation.authorDoc2 = body.authorDoc2;
|
||||
evaluation.subjectDoc2 = body.subjectDoc2;
|
||||
evaluation.assignedPosition = body.assignedPosition;
|
||||
evaluation.assignedPosLevel = body.assignedPosLevel ? body.assignedPosLevel : evaluation.assignedPosLevel;
|
||||
evaluation.assignedPosLevel = body.assignedPosLevel
|
||||
? body.assignedPosLevel
|
||||
: evaluation.assignedPosLevel;
|
||||
evaluation.commanderFullnameDoc2 = body.commanderFullnameDoc2;
|
||||
evaluation.commanderOrgDoc2 = body.commanderOrgDoc2 ?? _null;
|
||||
evaluation.commanderOrgOldDoc2 = body.commanderOrgOldDoc2 ?? _null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue