From 8b0c69ba410a2c0464313c79552cf520ae9a5fed Mon Sep 17 00:00:00 2001 From: zhaobing Date: Tue, 27 Jun 2023 14:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=AE=B0=E5=BD=95-=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/equipment/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/app/lib/controllers/equipment/index.js b/api/app/lib/controllers/equipment/index.js index 7ec5058..b5e2776 100644 --- a/api/app/lib/controllers/equipment/index.js +++ b/api/app/lib/controllers/equipment/index.js @@ -8,7 +8,7 @@ async function getEquipment(ctx) { const sequelize = ctx.fs.dc.ORM const { clickHouse } = ctx.app.fs const { startTime, endTime, pageSize, pageIndex, projectId } = ctx.query - //console.log('ressss', ctx.query) + console.log('ressss', ctx.query) let whereOption = {} if (projectId) { whereOption.projectId = projectId @@ -49,10 +49,11 @@ async function getEquipment(ctx) { } ], where: { - $and: [ - sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '>=', moment(startTime).format('YYYY-MM-DD HH:mm:ss')), - sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '<=', moment(endTime).format('YYYY-MM-DD HH:mm:ss')), - ], + reportTime: { $between: [moment(startTime).format('YYYY-MM-DD HH:mm:ss'), moment(endTime).format('YYYY-MM-DD HH:mm:ss')] } + // $and: [ + // sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '>=', moment(startTime).format('YYYY-MM-DD HH:mm:ss')), + // sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '<=', moment(endTime).format('YYYY-MM-DD HH:mm:ss')), + // ], } })