Browse Source

用户姓名、部门

release_0.0.2
巴林闲侠 2 years ago
parent
commit
1fcdd18c62
  1. 2
      api/app/lib/controllers/organization/index.js
  2. 2
      api/app/lib/service/clickHouseClient.js

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

@ -193,7 +193,7 @@ 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(',')})`).toPromise()
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()
for (let u of userRes.rows.concat(adminRes)) {
const corUsers = userPepRes.filter(up => up.id == u.pepUserId)

2
api/app/lib/service/clickHouseClient.js

@ -11,7 +11,7 @@ function factory (app, opts) {
app.fs.clickHouse[d.name] = new ClickHouse({
url: url,
port: port,
debug: true,
debug: opts.dev,
format: "json",
config: {
database: d.db,

Loading…
Cancel
Save