From 0ca7ccd083db1a472a862e5c36b04aa9f143c22b Mon Sep 17 00:00:00 2001 From: indes Date: Fri, 14 Jun 2019 15:41:28 +0800 Subject: [PATCH] fix(model): delete contents when no subscriber --- model/content.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/content.go b/model/content.go index 70a6682c..129ccb03 100644 --- a/model/content.go +++ b/model/content.go @@ -67,7 +67,7 @@ func GenContentAndCheckByFeedItem(s *Source, item *rss.Item) (*Content, bool, er func DeleteContentsBySourceID(sid uint) { db := getConnect() defer db.Close() - db.Where("source_id=?", sid).Delete(Content{}) + db.Delete(Content{}, "source_id = ?", sid) } func PublishItem(source *Source, item *rss.Item, html string) string {