Browse Source

feat:系统可用性更改

dev
zhaobing 2 years ago
parent
commit
5cea327e1c
  1. 2
      api/app/lib/controllers/operationData/index.js

2
api/app/lib/controllers/operationData/index.js

@ -44,7 +44,7 @@ async function getSystemAvailability(ctx) {
try { try {
const res = await sequelize.query( const res = await sequelize.query(
`SELECT substring(to_char(w.wmonth,'yyyy-mm'),1,7) wmonth, `SELECT substring(to_char(w.wmonth,'yyyy-mm'),1,7) wmonth,
COALESCE((w.seconds-e.counts)/w.seconds,0) ability COALESCE((w.seconds-e.counts)/w.seconds,1) ability
from ( from (
SELECT to_char(maintenance_record.occurrence_time, 'yyyy-MM') months, SELECT to_char(maintenance_record.occurrence_time, 'yyyy-MM') months,
SUM(maintenance_record.interrupt_duration) counts SUM(maintenance_record.interrupt_duration) counts

Loading…
Cancel
Save