no message

This commit is contained in:
Kittapath 2024-08-07 10:39:13 +07:00
parent 43a55e1764
commit 26492de4b8

View file

@ -254,21 +254,12 @@ export class kpiCapacityController extends Controller {
*/
@Get("summary")
async listSummaryKpiCapacity() {
// let kpiCapacity = await this.kpiCapacityRepository.find({
// groupby
// relations: ["kpiUserCapacitys"],
// });
const kpiCapacity = await AppDataSource.getRepository(KpiCapacity)
.createQueryBuilder("kpiCapacity")
.groupBy("kpiCapacity.type")
// .select("COUNT(kpiUserCapacitys.id) as total", "kpiCapacity")
.select(["kpiCapacity.type AS type", "COUNT(kpiCapacity.type) AS total"])
.getRawMany();
// const mapFormula = kpiCapacity.map((item) => ({
// name: item.name,
// total: item.kpiUserCapacitys.length + 1,
// }));
return new HttpSuccess(kpiCapacity);
}