Browse Source

feat:服务记录维护记录查询时间准确性

dev
zhaobing 2 years ago
parent
commit
0b5a1a2cd2
  1. 9
      api/app/lib/controllers/equipment/index.js

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

@ -23,10 +23,11 @@ async function getEquipment(ctx) {
where: whereOption where: whereOption
}], }],
where: { where: {
$and: [ reportTime: { $between: [moment(startTime).format('YYYY-MM-DD HH:mm:ss'), moment(endTime).format('YYYY-MM-DD HH:mm:ss')] }
sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '>=', moment(startTime).format('YYYY-MM-DD HH:mm:ss')), // $and: [
sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '<=', moment(endTime).format('YYYY-MM-DD HH:mm:ss')), // 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')),
// ],
} }

Loading…
Cancel
Save