diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-06 11:48:08 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-06 11:48:08 -0400 |
| commit | abe12120374d07cf5f87192964a9d1c10741e475 (patch) | |
| tree | 48a5c09e51863fe1508e7404cec2a9340e29f686 /lib/db/index.js | |
| parent | 5b1461e7b4d32e96eaa8386b4b7ea96ec4b18d5a (diff) | |
header
Diffstat (limited to 'lib/db/index.js')
| -rw-r--r-- | lib/db/index.js | 4 |
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 */ |
