Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 49s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 49s
This commit is contained in:
commit
51a9e9e145
1 changed files with 9 additions and 10 deletions
|
|
@ -170,20 +170,27 @@ export class DevelopmentScholarshipController extends Controller {
|
||||||
_data = x;
|
_data = x;
|
||||||
})
|
})
|
||||||
.catch((x) => {});
|
.catch((x) => {});
|
||||||
|
let _status:string = "";
|
||||||
if (keyword && ["กำลังศึกษา", "เรียนไม่จบ", "เรียนจบ"].includes(keyword.trim())) {
|
if (keyword && ["กำลังศึกษา", "เรียนไม่จบ", "เรียนจบ"].includes(keyword.trim())) {
|
||||||
const mapStatus: Record<string, string> = {
|
const mapStatus: Record<string, string> = {
|
||||||
"กำลังศึกษา": "PENDING",
|
"กำลังศึกษา": "PENDING",
|
||||||
"เรียนไม่จบ": "NOTGRADUATE",
|
"เรียนไม่จบ": "NOTGRADUATE",
|
||||||
"เรียนจบ": "GRADUATE",
|
"เรียนจบ": "GRADUATE",
|
||||||
};
|
};
|
||||||
keyword = mapStatus[keyword.trim()];
|
_status = mapStatus[keyword.trim()];
|
||||||
|
keyword = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
let query = await AppDataSource.getRepository(DevelopmentScholarship)
|
let query = await AppDataSource.getRepository(DevelopmentScholarship)
|
||||||
.createQueryBuilder("developmentScholarship")
|
.createQueryBuilder("developmentScholarship")
|
||||||
.leftJoinAndSelect("developmentScholarship.posLevel", "posLevel")
|
.leftJoinAndSelect("developmentScholarship.posLevel", "posLevel")
|
||||||
.leftJoinAndSelect("developmentScholarship.posType", "posType")
|
.leftJoinAndSelect("developmentScholarship.posType", "posType")
|
||||||
|
.andWhere(
|
||||||
|
_status != "" && keyword == ""
|
||||||
|
? "developmentScholarship.status = :status"
|
||||||
|
: "1=1",
|
||||||
|
{ status: _status },
|
||||||
|
)
|
||||||
.andWhere(
|
.andWhere(
|
||||||
year !== 0 && year != null && year != undefined
|
year !== 0 && year != null && year != undefined
|
||||||
? "developmentScholarship.scholarshipYear = :scholarshipYear"
|
? "developmentScholarship.scholarshipYear = :scholarshipYear"
|
||||||
|
|
@ -230,14 +237,6 @@ export class DevelopmentScholarshipController extends Controller {
|
||||||
keyword: `%${keyword}%`,
|
keyword: `%${keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.orWhere(
|
|
||||||
keyword != null && keyword != ""
|
|
||||||
? "developmentScholarship.status LIKE :keyword"
|
|
||||||
: "1=1",
|
|
||||||
{
|
|
||||||
keyword: `${keyword}`,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.orWhere(
|
.orWhere(
|
||||||
keyword != null && keyword != "" ? "posType.posTypeName LIKE :keyword" : "1=1",
|
keyword != null && keyword != "" ? "posType.posTypeName LIKE :keyword" : "1=1",
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue