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