|
|
@ -385,7 +385,11 @@ async function getStructuresUsers(ctx, next) { |
|
|
|
delete: false |
|
|
|
}, |
|
|
|
attributes: ['id', 'name', 'username', 'structure'], |
|
|
|
order: [['id', 'asc']] |
|
|
|
order: [['id', 'asc']], |
|
|
|
include: [{ |
|
|
|
model: models.Department, |
|
|
|
attributes: ['id', 'name',], |
|
|
|
}] |
|
|
|
}) |
|
|
|
|
|
|
|
let structs = await models.Project.findAll({ |
|
|
@ -398,7 +402,7 @@ async function getStructuresUsers(ctx, next) { |
|
|
|
rslt.push({ |
|
|
|
id: s.id, |
|
|
|
name: s.name, |
|
|
|
users: userRes.filter(x => x.structure && x.structure.find(v => v == s.id)).map(d => { return { id: d.id, name: d.name } }) |
|
|
|
users: userRes.filter(x => x.structure && x.structure.find(v => v == s.id)).map(d => { return { id: d.id, name: d.name, department: d.department } }) |
|
|
|
}); |
|
|
|
}) |
|
|
|
ctx.status = 200; |
|
|
|