diff options
author | Yorhel <git@yorhel.nl> | 2009-03-07 09:51:02 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-03-07 09:51:02 +0100 |
commit | 37196fc10d36249a525b07c1d74489bf259bde99 (patch) | |
tree | 0144c6e7a605a363f3a72de95a9ad1cb1e38c7a6 /lib/VNDB/DB/Tags.pm | |
parent | 0680666a8659e75a90d581f8f3a0e3172c16bcd1 (diff) |
Replacing random VN counts with actual data on tag pages
Just prototyping, current implementation is too slow for actual use.
Diffstat (limited to 'lib/VNDB/DB/Tags.pm')
-rw-r--r-- | lib/VNDB/DB/Tags.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm index e6607a2a..dfa9b6b3 100644 --- a/lib/VNDB/DB/Tags.pm +++ b/lib/VNDB/DB/Tags.pm @@ -44,7 +44,10 @@ sub dbTagGet { } if($o{what} =~ /childs\((\d+)\)/) { - $_->{childs} = $self->dbAll(q|SELECT lvl, tag, name FROM tag_tree(?, ?, true)|, $_->{id}, $1) for (@$r); + $_->{childs} = $self->dbAll( + q|SELECT lvl, tag, name, COALESCE((SELECT COUNT(*) FROM tags_vn_bayesian tb WHERE tb.tag = tt.tag), 0) AS vns FROM tag_tree(?, ?, true) tt|, + $_->{id}, $1 + ) for (@$r); } #if(@$r && $o{what} =~ /(?:parents)/) { |