From 490962dc4113db022547c6ad0a01832311c0202b Mon Sep 17 00:00:00 2001 From: wenlele Date: Thu, 6 Jul 2023 17:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/control/data.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/app/lib/controllers/control/data.js b/api/app/lib/controllers/control/data.js index 07a460b..96734c3 100644 --- a/api/app/lib/controllers/control/data.js +++ b/api/app/lib/controllers/control/data.js @@ -270,7 +270,7 @@ async function getLatestDynamic (ctx) { const { limit, page, projectCorrelationId, types } = ctx.query; const { userInfo } = ctx.fs.api; const { clickHouse } = ctx.app.fs; - limit = 1 + let where = { type: { $in: types.split(',') } }//传类型选择 if (!userInfo.role.includes('SuperAdmin') && !userInfo.role.includes('admin')) { where.projectCorrelationId = { $in: userInfo.correlationProject } @@ -278,7 +278,8 @@ async function getLatestDynamic (ctx) { if (projectCorrelationId) {//查指定项目,控制台全局切换 where.projectCorrelationId = projectCorrelationId } - console.log(101010, limit, page, projectCorrelationId, types); + console.log(1010, limit, page, projectCorrelationId, types); + let news = await models.LatestDynamicList.findAll({//最新动态 include: [{ model: models.ProjectCorrelation, @@ -296,8 +297,8 @@ async function getLatestDynamic (ctx) { model: models.AlarmConfirmLog }], where: where, - offset: Number(page) * Number(limit), - limit: Number(limit), + offset: 0, + limit: 1, order: [['time', 'desc']], });