fix find positionLevel
This commit is contained in:
parent
1155be4116
commit
5e8b372323
2 changed files with 9 additions and 7 deletions
|
|
@ -328,9 +328,15 @@ export class EmployeePositionController extends Controller {
|
|||
|
||||
case "positionLevel":
|
||||
if (!isNaN(Number(keyword))) {
|
||||
const findEmpLevels: EmployeePosLevel[] = await this.employeePosLevelRepository.find({
|
||||
where: { posLevelName: Number(keyword) },
|
||||
});
|
||||
let findEmpLevels;
|
||||
if(Number(keyword) === 0) {
|
||||
findEmpLevels = await this.employeePosLevelRepository.find();
|
||||
}
|
||||
else {
|
||||
findEmpLevels = await this.employeePosLevelRepository.find({
|
||||
where: { posLevelName: Number(keyword) },
|
||||
});
|
||||
}
|
||||
findData = await this.employeePosDictRepository.find({
|
||||
where: { posLevelId: In(findEmpLevels.map((x) => x.id)) },
|
||||
relations: ["posType", "posLevel"],
|
||||
|
|
|
|||
|
|
@ -672,10 +672,6 @@ export class PositionController extends Controller {
|
|||
case "positionExecutive":
|
||||
const findExecutive: PosExecutive[] = await this.posExecutiveRepository.find({
|
||||
where: { posExecutiveName: Like(`%${keyword}%`) },
|
||||
order: {
|
||||
// posExecutiveName: "ASC"
|
||||
posExecutivePriority: "ASC"
|
||||
},
|
||||
select: ["id"],
|
||||
});
|
||||
findPosDict = await this.posDictRepository.find({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue