Added lastActivityTime to accounts;

This commit is contained in:
2019-06-07 02:27:04 +10:00
parent e949b8f21f
commit 7c7aa26a1c
8 changed files with 37 additions and 7 deletions
+9 -1
View File
@@ -86,9 +86,17 @@ const isSpying = (connection, user, cb) => {
});
};
const logActivity = (connection, id) => {
let query = 'UPDATE accounts SET lastActivityTime = CURRENT_TIMESTAMP() WHERE id = ?;';
connection.query(query, [id], (err) => {
if (err) throw err;
});
};
module.exports = {
getStatistics: getStatistics,
getOwned: getOwned,
isAttacking: isAttacking,
isSpying: isSpying
isSpying: isSpying,
logActivity: logActivity
};