Handling DATE_ADD

This commit is contained in:
Louis Lam
2023-02-12 16:59:07 +08:00
parent 5388a37a26
commit 2e2747fb52
7 changed files with 34 additions and 7 deletions

View File

@@ -831,15 +831,17 @@ let needSetup = false;
throw new Error("Invalid period.");
}
const sqlHourOffset = Database.sqlHourOffset();
let list = await R.getAll(`
SELECT *
FROM heartbeat
WHERE monitor_id = ?
AND time > DATETIME('now', '-' || ? || ' hours')
AND time > ${sqlHourOffset}
ORDER BY time ASC
`, [
monitorID,
period,
-period,
]);
callback({