summaryrefslogtreecommitdiff
path: root/lib/db/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-06 11:48:08 -0400
committerJules Laplace <jules@okfoc.us>2015-09-06 11:48:08 -0400
commitabe12120374d07cf5f87192964a9d1c10741e475 (patch)
tree48a5c09e51863fe1508e7404cec2a9340e29f686 /lib/db/index.js
parent5b1461e7b4d32e96eaa8386b4b7ea96ec4b18d5a (diff)
header
Diffstat (limited to 'lib/db/index.js')
-rw-r--r--lib/db/index.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/db/index.js b/lib/db/index.js
index 994187e..e7ad632 100644
--- a/lib/db/index.js
+++ b/lib/db/index.js
@@ -53,6 +53,10 @@ db.getUserByUsername = function(username) {
var model = new User({'username': username})
return model.fetch()
}
+db.getLastlog = function(limit){
+ return knex.column('username').column('lastseen').select().from('users').orderBy('lastseen', 'desc').limit(limit || 10)
+}
+
/* THREADS */