fix ค้นหาผู้พ้นราชการ #871

This commit is contained in:
Bright 2024-12-24 10:20:04 +07:00
parent 0122d62614
commit 2a119b8bee
2 changed files with 16 additions and 2 deletions

View file

@ -4136,7 +4136,14 @@ export class ProfileController extends Controller {
.leftJoinAndSelect("current_holders.orgChild2", "orgChild2")
.leftJoinAndSelect("current_holders.orgChild3", "orgChild3")
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
.where("current_holders.orgRevisionId = :orgRevisionId", { orgRevisionId: findRevision.id })
.where(
node && nodeId
? "current_holders.orgRevisionId = :orgRevisionId"
: "1=1",
{
orgRevisionId: node && nodeId ? findRevision.id : undefined,
}
)
.andWhere(
_data.root != undefined && _data.root != null
? _data.root[0] != null