Browse Source

可用性更改

dev
zhaobing 2 years ago
parent
commit
35ae588a29
  1. 9
      api/app/lib/controllers/calculability/index.js

9
api/app/lib/controllers/calculability/index.js

@ -14,10 +14,11 @@ async function getCalculability(ctx) {
let recordRes = await models.MaintenanceRecord.findAndCount({ let recordRes = await models.MaintenanceRecord.findAndCount({
attributes: ['occurrenceTime', 'solvingTime'], attributes: ['occurrenceTime', 'solvingTime'],
where: { where: {
$and: [ occurrenceTime: { $between: [moment(sTime).format('YYYY-MM-DD HH:mm:ss'), moment(eTime).format('YYYY-MM-DD HH:mm:ss')] }
sequelize.where(sequelize.fn('date', sequelize.col('occurrence_time')), '>=', moment(sTime).format('YYYY-MM-DD HH:mm:ss')), // $and: [
sequelize.where(sequelize.fn('date', sequelize.col('occurrence_time')), '<=', moment(eTime).format('YYYY-MM-DD HH:mm:ss')), // 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')),
// ]
} }
}) })

Loading…
Cancel
Save