|
|
@ -35,8 +35,17 @@ async function inspectionList (ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs |
|
|
|
const { timeStart, timeEnd, projectId, appId, noted } = ctx.query |
|
|
|
|
|
|
|
let pomsProjectIds = null |
|
|
|
if (!projectId && !appId) { |
|
|
|
let pomsProject = await pomsProjectRange({ |
|
|
|
ctx, |
|
|
|
}) |
|
|
|
pomsProjectIds = pomsProject.map(p => p.id) |
|
|
|
} |
|
|
|
|
|
|
|
let findOption = { |
|
|
|
where: { |
|
|
|
|
|
|
@ -58,8 +67,10 @@ async function inspectionList (ctx) { |
|
|
|
projectId ? |
|
|
|
{ |
|
|
|
id: projectId |
|
|
|
} : |
|
|
|
{} |
|
|
|
} : {}, |
|
|
|
pomsProjectIds ? { |
|
|
|
id: { $in: pomsProjectIds } |
|
|
|
} : {} |
|
|
|
), |
|
|
|
attributes: { |
|
|
|
exclude: ['anxinProjectId', 'createTime', 'createUser'] |
|
|
|