Browse Source

治超筛查

dev
巴林闲侠 2 years ago
parent
commit
08ce145b11
  1. 4
      api/.vscode/launch.json
  2. 25
      api/app/lib/controllers/data/overspeed.js

4
api/.vscode/launch.json

@ -13,8 +13,8 @@
"NODE_ENV": "development"
},
"args": [
"-p 4000",
"-f http://localhost:4000",
"-p 14000",
"-f http://localhost:14000",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",

25
api/app/lib/controllers/data/overspeed.js

@ -34,16 +34,27 @@ async function overspeedGet (ctx) {
if (numberOfAxles) {
findOption.where.numberOfAxles = numberOfAxles
}
if (overrunRateUpper) {
findOption.where.overrunRate = {
$lte: overrunRateUpper
if (overrunRateUpper && overrunRateFloor) {
findOption.where['$and'] = []
findOption.where['$and'].push
({ overrunRate: { $lte: overrunRateUpper } })
findOption.where['$and'].push
({ overrunRate: { $gte: overrunRateFloor } })
} else {
if (overrunRateUpper) {
findOption.where.overrunRate = {
$lte: overrunRateUpper
}
}
}
if (overrunRateFloor) {
findOption.where.overrunRate = {
$gte: overrunRateFloor
if (overrunRateFloor) {
findOption.where.overrunRate = {
$gte: overrunRateFloor
}
}
}
if (testTime) {
findOption.where.testTime = {
$between: [moment(testTime).startOf('day').format(), moment(testTime).endOf('day').format()]

Loading…
Cancel
Save