|
|
@ -170,6 +170,8 @@ async function user (ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
const sequelize = ctx.fs.dc.orm; |
|
|
|
|
|
|
|
const { role, limit, page, } = ctx.query |
|
|
|
|
|
|
|
const excludeField = ['lastInTime', 'inTimes', 'onlineDuration', 'lastInAddress', 'deleted', 'updateTime'] |
|
|
@ -177,12 +179,19 @@ async function user (ctx) { |
|
|
|
let findOption = { |
|
|
|
attributes: { |
|
|
|
exclude: excludeField, |
|
|
|
// include: [[sequelize.fn('array_length', sequelize.col('role')), 'roleCount']]
|
|
|
|
}, |
|
|
|
where: { |
|
|
|
deleted: false, |
|
|
|
$not: { |
|
|
|
role: { $contained: ['SuperAdmin', 'admin'] } |
|
|
|
} |
|
|
|
$or: [{ |
|
|
|
$not: { |
|
|
|
role: { $contained: ['SuperAdmin', 'admin'] } |
|
|
|
} |
|
|
|
}, |
|
|
|
sequelize.where(sequelize.fn('cardinality', sequelize.col('role')), 0)], |
|
|
|
// $not: {
|
|
|
|
// role: { $contained: ['SuperAdmin', 'admin'] }
|
|
|
|
// }
|
|
|
|
}, |
|
|
|
order: [['updateTime', 'DESC']] |
|
|
|
} |
|
|
|