From bc12faa392dc7443eea59b3ad6b797267877fe4c Mon Sep 17 00:00:00 2001 From: yuanruji Date: Fri, 13 Sep 2024 11:02:37 +0800 Subject: [PATCH] 123 --- .../db-resource/internal/controller/statistic/statistic.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbm-services/common/db-resource/internal/controller/statistic/statistic.go b/dbm-services/common/db-resource/internal/controller/statistic/statistic.go index 5a54768523..900d32a9f8 100644 --- a/dbm-services/common/db-resource/internal/controller/statistic/statistic.go +++ b/dbm-services/common/db-resource/internal/controller/statistic/statistic.go @@ -60,8 +60,9 @@ type CountGroupbyResourceTypeResult struct { // CountGroupbyResourceType count groupby resource type func (s *Handler) CountGroupbyResourceType(c *gin.Context) { var data []CountGroupbyResourceTypeResult - err := model.DB.Self.Table(model.TbRpDetailName()).Select("rs_type, count(*) as count").Group("rs_type").Find(&data). - Error + err := model.DB.Self.Table(model.TbRpDetailName()). + Select("rs_type, count(*) as count").Group("rs_type"). + Find(&data, "status = ? ", model.Unused).Error if err != nil { logger.Error("query failed %s", err.Error) s.SendResponse(c, err, err.Error(), "")