From a59f3d3c3c196709c8e6af0285d2d70ec57de685 Mon Sep 17 00:00:00 2001 From: Suraj Date: Sat, 13 Feb 2016 01:05:42 +0530 Subject: [PATCH] show 0 count for category with no tasks in navigation drawer --- db/files.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/files.go b/db/files.go index 0ae0c02..05077e2 100644 --- a/db/files.go +++ b/db/files.go @@ -46,7 +46,7 @@ func GetFileName(token string) (string, error) { //GetCategories will return the list of categories to be //rendered in the template func GetCategories() []types.CategoryCount { - stmt := "select c.name, count(*) from category c left outer join task t where c.id = t.cat_id and t.is_deleted='N' and t.finish_date is null group by name union select name, 0 from category where name not in (select distinct name from task t join category c on t.cat_id = c.id)" + stmt := "select c.name, count(*) from category c left outer join task t where c.id = t.cat_id and t.is_deleted='N' and t.finish_date is null group by name union select name, 0 from category where name not in (select distinct name from task t join category c on t.cat_id = c.id and is_deleted!='Y')" rows := database.query(stmt) var categories []types.CategoryCount var category types.CategoryCount