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