From abe12120374d07cf5f87192964a9d1c10741e475 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 6 Sep 2015 11:48:08 -0400 Subject: header --- lib/db/index.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/db/index.js') 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 */ -- cgit v1.2.3-70-g09d2