Browse Source

服务记录-维护记录查询bug修改

dev
zhaobing 2 years ago
parent
commit
8b0c69ba41
  1. 11
      api/app/lib/controllers/equipment/index.js

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

@ -8,7 +8,7 @@ async function getEquipment(ctx) {
const sequelize = ctx.fs.dc.ORM
const { clickHouse } = ctx.app.fs
const { startTime, endTime, pageSize, pageIndex, projectId } = ctx.query
//console.log('ressss', ctx.query)
console.log('ressss', ctx.query)
let whereOption = {}
if (projectId) {
whereOption.projectId = projectId
@ -49,10 +49,11 @@ async function getEquipment(ctx) {
}
],
where: {
$and: [
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')),
],
reportTime: { $between: [moment(startTime).format('YYYY-MM-DD HH:mm:ss'), moment(endTime).format('YYYY-MM-DD HH:mm:ss')] }
// $and: [
// 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