This commit is contained in:
2025-10-29 19:07:00 +08:00
parent 8d48576305
commit ff45c59946
2 changed files with 5 additions and 1 deletions

View File

@@ -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)

View File

@@ -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)
}
}