|
|
@ -119,22 +119,30 @@ async function searchPepMember (ctx) { |
|
|
|
userRes.forEach(u => { |
|
|
|
let existUser = returnD.find(r => r.pepUserId == u.pepUserId) |
|
|
|
if (existUser) { |
|
|
|
existUser.departmrnt.push({ |
|
|
|
name: u.depName |
|
|
|
}) |
|
|
|
existUser.role.push({ |
|
|
|
name: u.roleName |
|
|
|
}) |
|
|
|
if (u.depId && !existUser.departmrnt.some(d => d.id == u.depId)) { |
|
|
|
existUser.departmrnt.push({ |
|
|
|
id: u.depId, |
|
|
|
name: u.depName |
|
|
|
}) |
|
|
|
} |
|
|
|
if (u.roleId && !existUser.role.some(r => r.id == u.roleId)) { |
|
|
|
existUser.role.push({ |
|
|
|
id: u.roleId, |
|
|
|
name: u.roleName |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
returnD.push({ |
|
|
|
pepUserId: u.pepUserId, |
|
|
|
name: u.userName, |
|
|
|
departmrnt: [{ |
|
|
|
departmrnt: u.depId ? [{ |
|
|
|
id: u.depId, |
|
|
|
name: u.depName |
|
|
|
}], |
|
|
|
role: [{ |
|
|
|
}] : [], |
|
|
|
role: u.roleId ? [{ |
|
|
|
id: u.roleId, |
|
|
|
name: u.roleName |
|
|
|
}] |
|
|
|
}] : [], |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
@ -196,6 +204,7 @@ async function list (ctx) { |
|
|
|
&& nowTime.isBefore(moment(curDay + ' 17:30')) |
|
|
|
) { |
|
|
|
// 在工作日的工作时间范围
|
|
|
|
whereOption.push(``) |
|
|
|
} |
|
|
|
} else { |
|
|
|
ctx.body = [] |
|
|
|