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']], });