@ -40,10 +40,8 @@ async function list (ctx) {
ctx, pepProjectId, keywordTarget, keyword
})
let whereOption = []
// ! 1 开发临时增加
if (anxinStruc.length) {
const anxinStrucIds = anxinStruc.map(a => a.strucId)
// ! 开发临时注释
whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")})`)
if (groupId) {
@ -74,7 +74,7 @@ async function editUser (ctx) {
if (existUserRes) {
// 存在且传递id 或者 不传id也存在
// 修改 update
storageData.deleted = false
if (
role.includes('admin')
) {
@ -89,6 +89,8 @@ async function editUser (ctx) {
// 正在修改成员 但是此时还是管理员
storageData.disabled = true
storageData.role = [...role, 'admin']
}else{
}
await models.User.update(storageData, {
where: {
@ -165,6 +167,9 @@ async function delAdmin (ctx) {
let adminIndex = updateValues.role.findIndex(r => r == 'admin')
if (adminIndex > -1) {
updateValues.role.splice(adminIndex, 1)
if (updateValues.role.length < 1) {
updateValues.deleted = true
await models.User.update(updateValues, {
@ -34,7 +34,7 @@ async function list (ctx) {
if (keywordTarget == 'tactics') {
findOption.where.name = { $like: `%${keyword}%` }
} else if (keywordTarget == 'struc') {
let bindAnixinStrucRes = await clickHouse.projectManage.query(`
let bindAnixinStrucRes = await clickHouse.anxinyun.query(`
SELECT id, name FROM t_structure
WHERE name LIKE '%${keyword}%'
`).toPromise()
@ -144,7 +144,7 @@ async function list (ctx) {
...p,
pomsProject: corBind,
structure: returnStruc,
pushCount: corLogCount ? corLogCount.count : 0,
pushCount: corLogCount ? corLogCount.dataValues.count : 0,
receiverPepUser: corReceiver
@ -185,7 +185,7 @@ async function edit (ctx) {
if (repeatRes) {
throw `已有名称为[${name}]的同名策略`
if (pushId) {
await models.AlarmPushConfig.update(storageData, {