This commit is contained in:
parent
d8ec3b2201
commit
cc1e591bfa
1 changed files with 40 additions and 5 deletions
|
|
@ -3626,6 +3626,7 @@ export class ReportController extends Controller {
|
||||||
.where("posMaster.orgRootId = :nodeId", { nodeId })
|
.where("posMaster.orgRootId = :nodeId", { nodeId })
|
||||||
.andWhere("posMaster.orgChild1Id IS NULL") // เฉพาะ root level
|
.andWhere("posMaster.orgChild1Id IS NULL") // เฉพาะ root level
|
||||||
.orderBy("posMaster.posMasterOrder", "ASC")
|
.orderBy("posMaster.posMasterOrder", "ASC")
|
||||||
|
.addOrderBy("posMaster.posMasterCreatedAt", "ASC")
|
||||||
.getMany();
|
.getMany();
|
||||||
|
|
||||||
// Step 3: ดึงข้อมูล Profiles ที่ใช้จริงเท่านั้น
|
// Step 3: ดึงข้อมูล Profiles ที่ใช้จริงเท่านั้น
|
||||||
|
|
@ -3804,6 +3805,7 @@ export class ReportController extends Controller {
|
||||||
.where("posMaster.orgChild1Id IN (:...orgChild1Ids)", { orgChild1Ids })
|
.where("posMaster.orgChild1Id IN (:...orgChild1Ids)", { orgChild1Ids })
|
||||||
.andWhere("posMaster.orgChild2Id IS NULL") // เฉพาะ child1 level
|
.andWhere("posMaster.orgChild2Id IS NULL") // เฉพาะ child1 level
|
||||||
.orderBy("posMaster.posMasterOrder", "ASC")
|
.orderBy("posMaster.posMasterOrder", "ASC")
|
||||||
|
.addOrderBy("posMaster.posMasterCreatedAt", "ASC")
|
||||||
.getMany();
|
.getMany();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3984,6 +3986,7 @@ export class ReportController extends Controller {
|
||||||
.where("posMaster.orgChild2Id IN (:...orgChild2Ids)", { orgChild2Ids })
|
.where("posMaster.orgChild2Id IN (:...orgChild2Ids)", { orgChild2Ids })
|
||||||
.andWhere("posMaster.orgChild3Id IS NULL") // เฉพาะ child2 level
|
.andWhere("posMaster.orgChild3Id IS NULL") // เฉพาะ child2 level
|
||||||
.orderBy("posMaster.posMasterOrder", "ASC")
|
.orderBy("posMaster.posMasterOrder", "ASC")
|
||||||
|
.addOrderBy("posMaster.posMasterCreatedAt", "ASC")
|
||||||
.getMany();
|
.getMany();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4164,6 +4167,7 @@ export class ReportController extends Controller {
|
||||||
.where("posMaster.orgChild3Id IN (:...orgChild3Ids)", { orgChild3Ids })
|
.where("posMaster.orgChild3Id IN (:...orgChild3Ids)", { orgChild3Ids })
|
||||||
.andWhere("posMaster.orgChild4Id IS NULL") // เฉพาะ child3 level
|
.andWhere("posMaster.orgChild4Id IS NULL") // เฉพาะ child3 level
|
||||||
.orderBy("posMaster.posMasterOrder", "ASC")
|
.orderBy("posMaster.posMasterOrder", "ASC")
|
||||||
|
.addOrderBy("posMaster.posMasterCreatedAt", "ASC")
|
||||||
.getMany();
|
.getMany();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4342,6 +4346,7 @@ export class ReportController extends Controller {
|
||||||
])
|
])
|
||||||
.where("posMaster.orgChild4Id IN (:...orgChild4Ids)", { orgChild4Ids })
|
.where("posMaster.orgChild4Id IN (:...orgChild4Ids)", { orgChild4Ids })
|
||||||
.orderBy("posMaster.posMasterOrder", "ASC")
|
.orderBy("posMaster.posMasterOrder", "ASC")
|
||||||
|
.addOrderBy("posMaster.posMasterCreatedAt", "ASC")
|
||||||
.getMany();
|
.getMany();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8814,7 +8819,13 @@ export class ReportController extends Controller {
|
||||||
id: nodeId,
|
id: nodeId,
|
||||||
// orgRevisionId: orgRevision.id,
|
// orgRevisionId: orgRevision.id,
|
||||||
},
|
},
|
||||||
order: { orgRootOrder: "ASC" },
|
order: {
|
||||||
|
orgRootOrder: "ASC",
|
||||||
|
posMasters:{
|
||||||
|
posMasterOrder: "ASC",
|
||||||
|
posMasterCreatedAt: "ASC"
|
||||||
|
}
|
||||||
|
},
|
||||||
relations: [
|
relations: [
|
||||||
"posMasters",
|
"posMasters",
|
||||||
"posMasters.orgRoot",
|
"posMasters.orgRoot",
|
||||||
|
|
@ -8848,7 +8859,13 @@ export class ReportController extends Controller {
|
||||||
where: {
|
where: {
|
||||||
orgRootId: In(orgRootIds),
|
orgRootId: In(orgRootIds),
|
||||||
},
|
},
|
||||||
order: { orgChild1Order: "ASC" },
|
order: {
|
||||||
|
orgChild1Order: "ASC",
|
||||||
|
posMasters:{
|
||||||
|
posMasterOrder: "ASC",
|
||||||
|
posMasterCreatedAt: "ASC"
|
||||||
|
}
|
||||||
|
},
|
||||||
relations: [
|
relations: [
|
||||||
"posMasters",
|
"posMasters",
|
||||||
"posMasters.orgRoot",
|
"posMasters.orgRoot",
|
||||||
|
|
@ -8880,7 +8897,13 @@ export class ReportController extends Controller {
|
||||||
where: {
|
where: {
|
||||||
orgChild1: In(orgChild1Ids),
|
orgChild1: In(orgChild1Ids),
|
||||||
},
|
},
|
||||||
order: { orgChild2Order: "ASC" },
|
order: {
|
||||||
|
orgChild2Order: "ASC",
|
||||||
|
posMasters:{
|
||||||
|
posMasterOrder: "ASC",
|
||||||
|
posMasterCreatedAt: "ASC"
|
||||||
|
}
|
||||||
|
},
|
||||||
relations: [
|
relations: [
|
||||||
"posMasters",
|
"posMasters",
|
||||||
"posMasters.orgRoot",
|
"posMasters.orgRoot",
|
||||||
|
|
@ -8912,7 +8935,13 @@ export class ReportController extends Controller {
|
||||||
where: {
|
where: {
|
||||||
orgChild2: In(orgChild2Ids),
|
orgChild2: In(orgChild2Ids),
|
||||||
},
|
},
|
||||||
order: { orgChild3Order: "ASC" },
|
order: {
|
||||||
|
orgChild3Order: "ASC",
|
||||||
|
posMasters:{
|
||||||
|
posMasterOrder: "ASC",
|
||||||
|
posMasterCreatedAt: "ASC"
|
||||||
|
}
|
||||||
|
},
|
||||||
relations: [
|
relations: [
|
||||||
"posMasters",
|
"posMasters",
|
||||||
"posMasters.orgRoot",
|
"posMasters.orgRoot",
|
||||||
|
|
@ -8944,7 +8973,13 @@ export class ReportController extends Controller {
|
||||||
where: {
|
where: {
|
||||||
orgChild3: In(orgChild3Ids),
|
orgChild3: In(orgChild3Ids),
|
||||||
},
|
},
|
||||||
order: { orgChild4Order: "ASC" },
|
order: {
|
||||||
|
orgChild4Order: "ASC",
|
||||||
|
posMasters:{
|
||||||
|
posMasterOrder: "ASC",
|
||||||
|
posMasterCreatedAt: "ASC"
|
||||||
|
}
|
||||||
|
},
|
||||||
relations: [
|
relations: [
|
||||||
"posMasters",
|
"posMasters",
|
||||||
"posMasters.orgRoot",
|
"posMasters.orgRoot",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue