diff --git a/internal/app/controller/plan/plan_controller.go b/internal/app/controller/plan/plan_controller.go index 1671d96..b682227 100644 --- a/internal/app/controller/plan/plan_controller.go +++ b/internal/app/controller/plan/plan_controller.go @@ -166,7 +166,7 @@ func (c *Controller) ListPlans(ctx *gin.Context) { } // 1. 调用仓库层获取所有计划 - opts := repository.ListPlansOptions{PlanType: repository.PlanTypeFilter(query.PlanType)} + opts := repository.ListPlansOptions{PlanType: query.PlanType} plans, total, err := c.planRepo.ListPlans(opts, query.Page, query.PageSize) if err != nil { c.logger.Errorf("%s: 数据库查询失败: %v", actionType, err) diff --git a/internal/app/service/monitor_service.go b/internal/app/service/monitor_service.go index ba282c7..e318f19 100644 --- a/internal/app/service/monitor_service.go +++ b/internal/app/service/monitor_service.go @@ -98,10 +98,14 @@ func (s *monitorService) ListPlanExecutionLogs(opts repository.PlanExecutionLogL } planIds := []uint{} for _, datum := range planLogs { + has := false for _, id := range planIds { if id == datum.PlanID { + has = true break } + } + if !has { planIds = append(planIds, datum.PlanID) } }