From a75716b803f2b6ea2d007595ab408e65cd5a329e Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 13 Jul 2023 09:17:02 +0800 Subject: [PATCH] =?UTF-8?q?reportList=20=E6=B7=BB=E5=8A=A0=20handleState?= =?UTF-8?q?=E3=80=81performerId=20=E7=AD=9B=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) {