Browse Source

人员信息查询

dev
巴林闲侠 2 years ago
parent
commit
a78ece1510
  1. 4
      api/app/lib/controllers/organization/index.js

4
api/app/lib/controllers/organization/index.js

@ -193,7 +193,9 @@ async function user (ctx) {
for (let u of userRes.rows.concat(adminRes)) {
userIds.add(u.pepUserId)
}
let userPepRes = await clickHouse.pepEmis.query(`SELECT user.id AS id, "user"."name" AS name, department.name AS depName, department.id AS depId FROM department_user LEFT JOIN user ON department_user.user=user.id LEFT JOIN department ON department.id=department_user.department WHERE user.id IN (${[...userIds].join(',')}) AND department.delete=false`).toPromise()
let userPepRes = userIds.size ?
await clickHouse.pepEmis.query(`SELECT DISTINCT user.id AS id, "user"."name" AS name, department.name AS depName, department.id AS depId FROM department_user LEFT JOIN user ON department_user.user=user.id LEFT JOIN department ON department.id=department_user.department WHERE user.id IN (${[...userIds].join(',')}) AND department.delete=false`).toPromise() :
[]
for (let u of userRes.rows.concat(adminRes)) {
const corUsers = userPepRes.filter(up => up.id == u.pepUserId)

Loading…
Cancel
Save