Browse Source

fix 应用告警关键字查询

dev
巴林闲侠 2 years ago
parent
commit
cb119faa3b
  1. 18
      api/app/lib/controllers/alarm/app.js

18
api/app/lib/controllers/alarm/app.js

@ -249,16 +249,14 @@ async function apiErrorList (ctx) {
${pepProjectSql} ${pepProjectSql}
WHERE project_name LIKE '%${keyword}%'` WHERE project_name LIKE '%${keyword}%'`
).toPromise() ).toPromise()
if (projectRes.length) { findOption.where.$or.push(
findOption.where.$or.push( {
{ '$app->projectCorrelations.pep_project_id$': {
'$app->projectCorrelations.pep_project_id$': { $in: projectRes.map(p => p.id)
$in: projectRes.map(p => p.id) },
}, '$app.name$': { $like: `%${keyword}%` }
'$app.name$': { $like: `%${keyword}%` } }
} )
)
}
} }
// if (errType) { // if (errType) {

Loading…
Cancel
Save