summaryrefslogtreecommitdiff
path: root/bucky/db
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-22 07:11:26 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-22 07:11:26 +0100
commitfa4ed0f3b1ce5decfc6ee59d38e63e78a7793de4 (patch)
tree74658c754cbdff432aa8dc8b4f3521c993993c45 /bucky/db
parent1a67f6f262364ee4fed0c1538ef2f41d772bf1b1 (diff)
new keyword form
Diffstat (limited to 'bucky/db')
-rw-r--r--bucky/db/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js
index e26124a..d3ee2ea 100644
--- a/bucky/db/index.js
+++ b/bucky/db/index.js
@@ -224,7 +224,7 @@ db.getKeyword = function (keyword) {
return Keyword.query("where", "keyword", "=", keyword).fetch()
}
db.getThreadGroups = function (keyword) {
- return knex.column('keyword').sum('viewed').as('viewed').column('id').column('title').column('lastmodified').column('privacy').select().from('threads').groupBy('keyword')
+ return knex.column('keyword').sum('viewed').as('viewed').count('*').as('count').column('id').column('title').column('lastmodified').column('privacy').select().from('threads').groupBy('keyword')
}
db.createKeyword = function(data){
return new db.Keyword(data).save()