Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 49s

This commit is contained in:
harid 2025-12-16 14:20:01 +07:00
commit 51a9e9e145

View file

@ -170,20 +170,27 @@ export class DevelopmentScholarshipController extends Controller {
_data = x;
})
.catch((x) => {});
let _status:string = "";
if (keyword && ["กำลังศึกษา", "เรียนไม่จบ", "เรียนจบ"].includes(keyword.trim())) {
const mapStatus: Record<string, string> = {
"กำลังศึกษา": "PENDING",
"เรียนไม่จบ": "NOTGRADUATE",
"เรียนจบ": "GRADUATE",
};
keyword = mapStatus[keyword.trim()];
_status = mapStatus[keyword.trim()];
keyword = "";
}
let query = await AppDataSource.getRepository(DevelopmentScholarship)
.createQueryBuilder("developmentScholarship")
.leftJoinAndSelect("developmentScholarship.posLevel", "posLevel")
.leftJoinAndSelect("developmentScholarship.posType", "posType")
.andWhere(
_status != "" && keyword == ""
? "developmentScholarship.status = :status"
: "1=1",
{ status: _status },
)
.andWhere(
year !== 0 && year != null && year != undefined
? "developmentScholarship.scholarshipYear = :scholarshipYear"
@ -230,14 +237,6 @@ export class DevelopmentScholarshipController extends Controller {
keyword: `%${keyword}%`,
},
)
.orWhere(
keyword != null && keyword != ""
? "developmentScholarship.status LIKE :keyword"
: "1=1",
{
keyword: `${keyword}`,
},
)
.orWhere(
keyword != null && keyword != "" ? "posType.posTypeName LIKE :keyword" : "1=1",
{