Browse Source

api

release_0.0.1
巴林闲侠 2 years ago
parent
commit
bb27f44219
  1. 12
      api/app/lib/controllers/overview/building.js
  2. 10
      api/app/lib/controllers/overview/management.js
  3. 3
      api/log/development.log

12
api/app/lib/controllers/overview/building.js

@ -170,11 +170,13 @@ async function roadState (ctx) {
}
}
let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '')
if (roadState.townProject[townName]) {
roadState.townProject[townName] += 1
} else {
roadState.townProject[townName] = 1
if (p.buildUnit) {
let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '')
if (roadState.townProject[townName]) {
roadState.townProject[townName] += 1
} else {
roadState.townProject[townName] = 1
}
}
}

10
api/app/lib/controllers/overview/management.js

@ -4,15 +4,23 @@ async function overSpeedList (ctx) {
try {
const models = ctx.fs.dc.models;
const { userId } = ctx.fs.api;
const { limit } = ctx.query;
const overSpeedRes = await models.Overspeed.findAll({
attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime'],
order: [['testTime', 'DESC']],
limit: limit || 120,
})
const overSpeedProcessedCount = await models.Overspeed.count({
where: {
processingTime: { $ne: null }
}
})
ctx.status = 200
ctx.body = {
processed: overSpeedRes.filter(s => s.processingTime).length,
processed: overSpeedProcessedCount,
overSpeedList: overSpeedRes,
}
} catch (error) {

3
api/log/development.log

@ -8534,3 +8534,6 @@
original: { '$ref': '$["parent"]' },
__stackCleaned__: true
}
2022-07-26 09:52:19.623 - debug: [FS-LOGGER] Init.
2022-07-26 09:52:19.753 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-26 09:52:19.753 - info: [FS-AUTH] Inject auth and api mv into router.

Loading…
Cancel
Save