|
|
@ -153,7 +153,11 @@ async function busRunRealTime (ctx) { |
|
|
|
let now = moment() |
|
|
|
let hourBefour = now.subtract(1, 'h') |
|
|
|
ctx.status = 200; |
|
|
|
ctx.body = (busRunRes || []).filter(b => b.runState == 1 && moment(b.siteTime).isAfter(hourBefour) && busCarRes.some(bc => bc.vehicleLicensePlateNumber == b.busNoChar)) |
|
|
|
ctx.body = (busRunRes || []).filter(b => { |
|
|
|
return b.runState == 1 |
|
|
|
&& moment(b.siteTime).isAfter(hourBefour) |
|
|
|
&& busCarRes.some(bc => bc.vehicleLicensePlateNumber == b.busNoChar) |
|
|
|
}) |
|
|
|
} catch (error) { |
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: error`); |
|
|
|
ctx.status = 400; |
|
|
|