fix
This commit is contained in:
parent
396ef9400e
commit
7550ea729b
1 changed files with 17 additions and 13 deletions
|
|
@ -70,23 +70,27 @@ async updateKpiEvaluations(
|
||||||
*/
|
*/
|
||||||
@Get()
|
@Get()
|
||||||
async listKpiEvaluation(
|
async listKpiEvaluation(
|
||||||
@Query("page") page: number = 1,
|
// @Query("page") page: number = 1,
|
||||||
@Query("pageSize") pageSize: number = 10,
|
// @Query("pageSize") pageSize: number = 10,
|
||||||
@Query("keyword") keyword?: string,
|
// @Query("keyword") keyword?: string,
|
||||||
) {
|
) {
|
||||||
let whereClause: any = {};
|
let whereClause: any = {};
|
||||||
|
|
||||||
if (keyword !== undefined && keyword !== "") {
|
// if (keyword !== undefined && keyword !== "") {
|
||||||
whereClause = {
|
// whereClause = {
|
||||||
where: [{ description: Like(`%${keyword}%`) }],
|
// where: [{ description: Like(`%${keyword}%`) }],
|
||||||
};
|
// };
|
||||||
whereClause.where.push({ level: Like(`%${keyword}%`) });
|
// whereClause.where.push({ level: Like(`%${keyword}%`) });
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
const [kpiEvaluation, total] = await this.kpiEvaluationRepository.findAndCount({
|
// const [kpiEvaluation, total] = await this.kpiEvaluationRepository.findAndCount({
|
||||||
...whereClause,
|
// ...whereClause,
|
||||||
...(keyword ? {} : { skip: (page - 1) * pageSize, take: pageSize }),
|
// ...(keyword ? {} : { skip: (page - 1) * pageSize, take: pageSize }),
|
||||||
|
// order:{
|
||||||
|
// level: "DESC"}
|
||||||
|
// });
|
||||||
|
const kpiEvaluation = await this.kpiEvaluationRepository.find({
|
||||||
order:{
|
order:{
|
||||||
level: "DESC"}
|
level: "DESC"}
|
||||||
});
|
});
|
||||||
|
|
@ -96,6 +100,6 @@ async updateKpiEvaluations(
|
||||||
level: item.level,
|
level: item.level,
|
||||||
description: item.description
|
description: item.description
|
||||||
}));
|
}));
|
||||||
return new HttpSuccess({ data: formatted, total });
|
return new HttpSuccess(formatted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue