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;
|
||||
})
|
||||
.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",
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue