diff options
Diffstat (limited to 'pkg/app/list/show.go')
-rw-r--r-- | pkg/app/list/show.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/app/list/show.go b/pkg/app/list/show.go index 8db8778..d90f236 100644 --- a/pkg/app/list/show.go +++ b/pkg/app/list/show.go @@ -18,17 +18,17 @@ func Show(w http.ResponseWriter, r *http.Request) { } err := database.DBCon.Model((*models.Message)(nil)). WhereGroup(func(q *orm.Query) (*orm.Query, error) { - q = q.WhereOr(`(headers::jsonb->>'Subject')::jsonb->>0 LIKE '[` + listName + `]%'`). - WhereOr(`(headers::jsonb->>'Subject')::jsonb->>0 LIKE 'Re: [` + listName + `]%'`) - return q, nil - }). - WhereGroup(func(q *orm.Query) (*orm.Query, error) { - q = q.WhereOr(`headers::jsonb->>'To' LIKE '%` + listName + `@lists.gentoo.org%'`). - WhereOr(`headers::jsonb->>'Cc' LIKE '%` + listName + `@lists.gentoo.org%'`). - WhereOr(`headers::jsonb->>'To' LIKE '%` + listName + `@gentoo.org%'`). - WhereOr(`headers::jsonb->>'Cc' LIKE '%` + listName + `@gentoo.org%'`) + q = q.WhereOr(`subject LIKE '[` + listName + `]%'`). + WhereOr(`subject LIKE 'Re: [` + listName + `]%'`) return q, nil }). + //WhereGroup(func(q *orm.Query) (*orm.Query, error) { + // q = q.WhereOr(`to LIKE '%` + listName + `@lists.gentoo.org%'`). + // WhereOr(`cc LIKE '%` + listName + `@lists.gentoo.org%'`). + // WhereOr(`to LIKE '%` + listName + `@gentoo.org%'`). + // WhereOr(`cc LIKE '%` + listName + `@gentoo.org%'`) + // return q, nil + //}). ColumnExpr("to_char(date, 'YYYY-MM') AS combined_date"). ColumnExpr("count(*) AS message_count"). Group("combined_date"). |