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(), "")