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