fix
This commit is contained in:
parent
75cbef694a
commit
970662662f
1 changed files with 4 additions and 3 deletions
|
|
@ -63,11 +63,12 @@ export class ReoportController {
|
|||
const yearInAD = year?year:null;
|
||||
const yearInBE = yearInAD ? (parseInt(yearInAD) - 543).toString() : null;
|
||||
|
||||
const evaluation = await AppDataSource.getRepository(Evaluation)
|
||||
let evaluation = [];
|
||||
evaluation = await AppDataSource.getRepository(Evaluation)
|
||||
.createQueryBuilder("evaluation")
|
||||
.where('evaluation.evaluationResult NOT IN (:...evaluationResults)', { evaluationResults: ['PENDING'] })
|
||||
.andWhere( yearInBE && yearInBE != null? 'YEAR(createdAt) = :year': "1=1", { year: yearInBE })
|
||||
.andWhere(rootId?'orgRootId = :rootId': "1=1", { rootId: rootId })
|
||||
.andWhere('evaluation.orgRootId = :rootId',{ rootId: rootId })
|
||||
.andWhere('evaluation.step = :step', { step: 'DONE' })
|
||||
.getMany();
|
||||
|
||||
|
|
@ -114,7 +115,7 @@ export class ReoportController {
|
|||
data: {
|
||||
year: year?Extension.ToThaiNumber(year.toString()):Extension.ToThaiNumber(new Date().getFullYear().toString()),
|
||||
date: Extension.ToThaiNumber(Extension.ToThaiShortDate(new Date())),
|
||||
mainAgency: rootId && result.length > 0?result[0].agency:"ทุกสำนักงานเขต",
|
||||
mainAgency: rootId && result.length > 0?result[0].agency:"",
|
||||
list: result,
|
||||
total: Extension.ToThaiNumber(submitter.toString()),
|
||||
sumPass: Extension.ToThaiNumber(sumPass.toString()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue