mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
fix: some errors from the performance optimization (#5196)
This commit is contained in:
parent
b719d11500
commit
85dfe1f5d1
1 changed files with 6 additions and 9 deletions
|
@ -1508,10 +1508,8 @@ class Monitor extends BeanModel {
|
||||||
return await R.getAll(`
|
return await R.getAll(`
|
||||||
SELECT monitor_notification.monitor_id, monitor_notification.notification_id
|
SELECT monitor_notification.monitor_id, monitor_notification.notification_id
|
||||||
FROM monitor_notification
|
FROM monitor_notification
|
||||||
WHERE monitor_notification.monitor_id IN (?)
|
WHERE monitor_notification.monitor_id IN (${monitorIDs.map((_) => "?").join(",")})
|
||||||
`, [
|
`, monitorIDs);
|
||||||
monitorIDs,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1521,13 +1519,11 @@ class Monitor extends BeanModel {
|
||||||
*/
|
*/
|
||||||
static async getMonitorTag(monitorIDs) {
|
static async getMonitorTag(monitorIDs) {
|
||||||
return await R.getAll(`
|
return await R.getAll(`
|
||||||
SELECT monitor_tag.monitor_id, tag.name, tag.color
|
SELECT monitor_tag.monitor_id, monitor_tag.tag_id, tag.name, tag.color
|
||||||
FROM monitor_tag
|
FROM monitor_tag
|
||||||
JOIN tag ON monitor_tag.tag_id = tag.id
|
JOIN tag ON monitor_tag.tag_id = tag.id
|
||||||
WHERE monitor_tag.monitor_id IN (?)
|
WHERE monitor_tag.monitor_id IN (${monitorIDs.map((_) => "?").join(",")})
|
||||||
`, [
|
`, monitorIDs);
|
||||||
monitorIDs,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1567,6 +1563,7 @@ class Monitor extends BeanModel {
|
||||||
tagsMap.set(row.monitor_id, []);
|
tagsMap.set(row.monitor_id, []);
|
||||||
}
|
}
|
||||||
tagsMap.get(row.monitor_id).push({
|
tagsMap.get(row.monitor_id).push({
|
||||||
|
tag_id: row.tag_id,
|
||||||
name: row.name,
|
name: row.name,
|
||||||
color: row.color
|
color: row.color
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue