From 0b5a1a2cd2516890b592dab120ce983f64ddb868 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Sun, 25 Jun 2023 17:37:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9C=8D=E5=8A=A1=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=87=86=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/equipment/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/app/lib/controllers/equipment/index.js b/api/app/lib/controllers/equipment/index.js index 310b722..7ec5058 100644 --- a/api/app/lib/controllers/equipment/index.js +++ b/api/app/lib/controllers/equipment/index.js @@ -23,10 +23,11 @@ async function getEquipment(ctx) { where: whereOption }], 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')), + // ], }