แก้รักษาการเอา3อันดับแรก

This commit is contained in:
kittapath 2025-02-27 17:11:18 +07:00
parent 3102d9656d
commit c1400a2226

View file

@ -7087,9 +7087,10 @@ export class OrganizationController extends Controller {
(x) =>
x.orgChild1Id == null &&
// x.current_holderId != null &&
x.posMasterOrder <= 3 &&
x.isDirector === true,
)
.sort((a, b) => a.posMasterOrder - b.posMasterOrder) // Sort by posMasterOrder ASC
.slice(0, 3) // Select the first 3 rows
.map(async (x) => ({
posmasterId: x.id,
posNo: orgRoot.orgRootShortName + x.posMasterNo,
@ -7134,9 +7135,10 @@ export class OrganizationController extends Controller {
(x) =>
x.orgChild2Id == null &&
// x.current_holderId != null &&
x.posMasterOrder <= 3 &&
x.isDirector === true,
)
.sort((a, b) => a.posMasterOrder - b.posMasterOrder) // Sort by posMasterOrder ASC
.slice(0, 3) // Select the first 3 rows
.map(async (x) => ({
posmasterId: x.id,
posNo: orgChild1.orgChild1ShortName + x.posMasterNo,
@ -7189,9 +7191,10 @@ export class OrganizationController extends Controller {
(x) =>
x.orgChild3Id == null &&
// x.current_holderId != null &&
x.posMasterOrder <= 3 &&
x.isDirector === true,
)
.sort((a, b) => a.posMasterOrder - b.posMasterOrder) // Sort by posMasterOrder ASC
.slice(0, 3) // Select the first 3 rows
.map(async (x) => ({
posmasterId: x.id,
posNo: orgChild2.orgChild2ShortName + x.posMasterNo,
@ -7251,9 +7254,10 @@ export class OrganizationController extends Controller {
(x) =>
x.orgChild4Id == null &&
// x.current_holderId != null &&
x.posMasterOrder <= 3 &&
x.isDirector === true,
)
.sort((a, b) => a.posMasterOrder - b.posMasterOrder) // Sort by posMasterOrder ASC
.slice(0, 3) // Select the first 3 rows
.map(async (x) => ({
posmasterId: x.id,
posNo: orgChild3.orgChild3ShortName + x.posMasterNo,
@ -7319,8 +7323,10 @@ export class OrganizationController extends Controller {
.filter(
(x) =>
// x.current_holderId != null &&
x.posMasterOrder <= 3 && x.isDirector === true,
x.isDirector === true,
)
.sort((a, b) => a.posMasterOrder - b.posMasterOrder) // Sort by posMasterOrder ASC
.slice(0, 3) // Select the first 3 rows
.map(async (x) => ({
posmasterId: x.id,
posNo: orgChild4.orgChild4ShortName + x.posMasterNo,