diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 1ee76d04..255a9ac4 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -4,7 +4,7 @@ const { QueryTypes } = require('sequelize'); async function reportList (ctx) { try { const models = ctx.fs.dc.models; - const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType } = ctx.query + const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '' } = ctx.query const { userInfo } = ctx.fs.api const sequelize = ctx.fs.dc.orm; @@ -14,7 +14,7 @@ async function reportList (ctx) { && userInfo.isAdmin && userInfo.phone != 'SuperAdmin' ) { - // 是管理员但不是超管 查自己部门及下级部门的所有信息 + // 是管理员但不是超管 查自己部门及下级部门的所有用户的信息 const sqlStr = ` WITH RECURSIVE sub_departments AS ( SELECT id, dependence @@ -86,6 +86,14 @@ async function reportList (ctx) { if (projectType) { findOption.where.projectType = projectType } + if (performerId) { + let performerIds = performerId.split(',') + findOption.where.performerId = { $in: performerIds } + } + if (handleState) { + findOption.where.handleState = handleState + } + let reportRes = null; if (isTop) {