From 097d2709e28d930aaffce6204379cdd5ace2c56b Mon Sep 17 00:00:00 2001 From: lealife Date: Sat, 10 Oct 2015 14:33:40 +0800 Subject: [PATCH] =?UTF-8?q?tag=E6=A0=87=E9=A2=98=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/BlogService.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/service/BlogService.go b/app/service/BlogService.go index dc94156..d50e2f6 100644 --- a/app/service/BlogService.go +++ b/app/service/BlogService.go @@ -133,7 +133,8 @@ func (this *BlogService) ListBlogs(userId, notebookId string, page, pageSize int func (this *BlogService) GetBlogTags(userId string) []info.TagCount { // 得到所有博客 tagCounts := []info.TagCount{} - query := bson.M{"UserId": bson.ObjectIdHex(userId), "IsBlog": true} + // tag不能为空 + query := bson.M{"UserId": bson.ObjectIdHex(userId), "IsBlog": true, "Tag": bson.M{"$ne": ""}} db.TagCounts.Find(query).Sort("-Count").All(&tagCounts) return tagCounts }