From 35ae588a295c3f2e21e72e03bc44a866c7f63095 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Wed, 21 Jun 2023 15:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E7=94=A8=E6=80=A7=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/calculability/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/app/lib/controllers/calculability/index.js b/api/app/lib/controllers/calculability/index.js index 7ff8337..89129e1 100644 --- a/api/app/lib/controllers/calculability/index.js +++ b/api/app/lib/controllers/calculability/index.js @@ -14,10 +14,11 @@ async function getCalculability(ctx) { let recordRes = await models.MaintenanceRecord.findAndCount({ attributes: ['occurrenceTime', 'solvingTime'], where: { - $and: [ - sequelize.where(sequelize.fn('date', sequelize.col('occurrence_time')), '>=', moment(sTime).format('YYYY-MM-DD HH:mm:ss')), - sequelize.where(sequelize.fn('date', sequelize.col('occurrence_time')), '<=', moment(eTime).format('YYYY-MM-DD HH:mm:ss')), - ] + occurrenceTime: { $between: [moment(sTime).format('YYYY-MM-DD HH:mm:ss'), moment(eTime).format('YYYY-MM-DD HH:mm:ss')] } + // $and: [ + // sequelize.where(sequelize.fn('timestamp', sequelize.col('occurrence_time')), '>=', moment(sTime).format('YYYY-MM-DD HH:mm:ss')), + // sequelize.where(sequelize.fn('timestamp', sequelize.col('occurrence_time')), '<=', moment(eTime).format('YYYY-MM-DD HH:mm:ss')), + // ] } })