From a02c8b7c2d269f70fa2c8289dfd6e9340601e6d6 Mon Sep 17 00:00:00 2001 From: wenlele Date: Fri, 17 Mar 2023 17:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/.vscode/launch.json | 4 ++-- api/app/lib/controllers/project/index.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index a12977d..48e8f7a 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -56,9 +56,9 @@ // "--clickHouseDataAlarm default", // "--clickHouseIot iot", // 测试 - "--clickHouseAnxincloud anxinyun", + "--clickHouseAnxincloud anxinyun1", "--clickHousePepEmis pepca8", - "--clickHouseProjectManage peppm", + "--clickHouseProjectManage peppm8", "--clickHouseVcmp video_access_dev", "--clickHouseDataAlarm default", "--clickHouseIot iota", diff --git a/api/app/lib/controllers/project/index.js b/api/app/lib/controllers/project/index.js index 58f2e2f..64a0654 100644 --- a/api/app/lib/controllers/project/index.js +++ b/api/app/lib/controllers/project/index.js @@ -65,6 +65,7 @@ async function pomsProject (ctx) { WHERE project_name LIKE '%${keyword}%' ` ).toPromise() || [] + const anxinProjectRes = await clickHouse.anxinyun.query( `SELECT id,"name", project_state AS projectState @@ -75,12 +76,12 @@ async function pomsProject (ctx) { let anxinProjectId = anxinProjectRes.map(v => v.id) findOption.where.$or = [ - { name: { $like: `%${keyword}%` } },] + { name: { $like: `%${keyword}%` } } ] if (projectId.length > 0) { findOption.where.$or.push({ pepProjectId: { $in: projectId } }) } if (anxinProjectId.length > 0) { - findOption.where.$or.push({ anxinProjectId: { $contains: anxinProjectId } }) + findOption.where.$or.push({ anxinProjectId: { $overlap: anxinProjectId } }) } }