diff --git a/api/app/lib/controllers/equipment/index.js b/api/app/lib/controllers/equipment/index.js index 7ec5058..b5e2776 100644 --- a/api/app/lib/controllers/equipment/index.js +++ b/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')), + // ], } })