เพิ่มตำแหน่งในระดับ
This commit is contained in:
parent
8278d9ddff
commit
190451a910
1 changed files with 12 additions and 9 deletions
|
|
@ -97,14 +97,17 @@ export class ProfileSalaryController extends Controller {
|
|||
}))
|
||||
: [];
|
||||
|
||||
const posLevel: any = [
|
||||
// {
|
||||
// year: 1,
|
||||
// month: 0,
|
||||
// day: 0,
|
||||
// name: "ต้น",
|
||||
// }
|
||||
];
|
||||
const posLevel = await AppDataSource.query("CALL GetProfileSalaryLevel(?)", [profileId]);
|
||||
const _posLevel = posLevel.length > 0 ? posLevel[0] : [];
|
||||
const mapPosLevel =
|
||||
_posLevel.length > 1
|
||||
? _posLevel.slice(1).map((curr: any, index: number) => ({
|
||||
year: curr.Years ? Math.floor(Number(curr.Years)) : 0,
|
||||
month: curr.Months ? Math.floor(Number(curr.Months)) : 0,
|
||||
day: curr.Days ? Math.floor(Number(curr.Days)) : 0,
|
||||
name: _posLevel[index]?.positionLevel,
|
||||
}))
|
||||
: [];
|
||||
|
||||
const posExecutive = await AppDataSource.query("CALL GetProfileSalaryExecutive(?)", [
|
||||
profileId,
|
||||
|
|
@ -122,7 +125,7 @@ export class ProfileSalaryController extends Controller {
|
|||
|
||||
return new HttpSuccess({
|
||||
position: mapPosition,
|
||||
posLevel: posLevel,
|
||||
posLevel: mapPosLevel,
|
||||
posExecutive: mapPosExecutive,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue