diff --git a/api/app/lib/controllers/patrolRecord/patrolRecord.js b/api/app/lib/controllers/patrolRecord/patrolRecord.js index f00a75c..8f5893c 100644 --- a/api/app/lib/controllers/patrolRecord/patrolRecord.js +++ b/api/app/lib/controllers/patrolRecord/patrolRecord.js @@ -9,7 +9,7 @@ async function findPatrolRecord (ctx, next) { // patrolPlanId传all查所有 if (patrolPlanId == 'all') { /* 如果有startTime && endTime,查询所有符合条件的数据 */ - if (startTime && endTime) { + if (startTime !== 'null' && endTime !== 'null') { if (pointId) { rslt = await models.PatrolRecord.findAll({ where: { alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } }, @@ -32,7 +32,7 @@ async function findPatrolRecord (ctx, next) { }) } } else { - if (startTime && endTime) { + if (startTime !== 'null' && endTime !== 'null') { if (pointId) { rslt = await models.PatrolRecord.findAll({ where: { patrolPlanId: { $in: patrolPlanId.split(',') }, alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } },