เช็ค ประเมินผล #814

This commit is contained in:
Bright 2024-11-29 09:52:59 +07:00
parent 4721e9aeed
commit 0cfdc07253
2 changed files with 8 additions and 5 deletions

View file

@ -243,8 +243,9 @@ export class kpiPeriodController extends Controller {
year !== 0 && year != null && year != undefined ? "kpiPeriod.year = :year" : "1=1", year !== 0 && year != null && year != undefined ? "kpiPeriod.year = :year" : "1=1",
{ year: year }, { year: year },
) )
.orderBy("kpiPeriod.startDate", "ASC") .orderBy("kpiPeriod.year", "DESC")
.addOrderBy("kpiPeriod.year", "ASC") .addOrderBy("kpiPeriod.durationKPI", "DESC")
.addOrderBy("kpiPeriod.startDate", "DESC")
.skip((page - 1) * pageSize) .skip((page - 1) * pageSize)
.take(pageSize) .take(pageSize)
.getManyAndCount(); .getManyAndCount();
@ -296,8 +297,8 @@ export class kpiPeriodController extends Controller {
year !== 0 && year != null && year != undefined ? "kpiPeriod.year = :year" : "1=1", year !== 0 && year != null && year != undefined ? "kpiPeriod.year = :year" : "1=1",
{ year: year }, { year: year },
) )
.orderBy("kpiPeriod.startDate", "ASC") .orderBy("kpiPeriod.year", "DESC")
.addOrderBy("kpiPeriod.year", "ASC") .addOrderBy("kpiPeriod.createdAt", "DESC")
.skip((page - 1) * pageSize) .skip((page - 1) * pageSize)
.take(pageSize) .take(pageSize)
.getManyAndCount(); .getManyAndCount();

View file

@ -394,6 +394,7 @@ export class KpiUserEvaluationController extends Controller {
"CONCAT(kpiUserEvaluation.prefix, kpiUserEvaluation.firstName, ' ', kpiUserEvaluation.lastName) LIKE :keyword"; "CONCAT(kpiUserEvaluation.prefix, kpiUserEvaluation.firstName, ' ', kpiUserEvaluation.lastName) LIKE :keyword";
const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation) const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation)
.createQueryBuilder("kpiUserEvaluation") .createQueryBuilder("kpiUserEvaluation")
.leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod")
.andWhere( .andWhere(
requestBody.kpiPeriodId ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1", requestBody.kpiPeriodId ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1",
{ {
@ -450,7 +451,8 @@ export class KpiUserEvaluationController extends Controller {
}); });
}), }),
) )
.orderBy("kpiUserEvaluation.createdAt", "ASC") .orderBy("kpiPeriod.year", "DESC")
.addOrderBy("kpiUserEvaluation.createdAt", "DESC")
.skip((requestBody.page - 1) * requestBody.pageSize) .skip((requestBody.page - 1) * requestBody.pageSize)
.take(requestBody.pageSize) .take(requestBody.pageSize)
.getManyAndCount(); .getManyAndCount();