From 27e7a426b1c7ba7ec878204a937a0ecfff5214ed Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 22 Jul 2021 22:44:34 +0200 Subject: Add user and category filter on post search Add a user and category filter option for the post search in the administration area. Filter on default theme is followed later. --- core/namespace/ORM/RepositorySearch.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core') diff --git a/core/namespace/ORM/RepositorySearch.php b/core/namespace/ORM/RepositorySearch.php index 8a61998..aac46ef 100644 --- a/core/namespace/ORM/RepositorySearch.php +++ b/core/namespace/ORM/RepositorySearch.php @@ -24,6 +24,16 @@ trait RepositorySearch { $params[] = $filter['day']; } + if(is_numeric($filter['user'] ?? NULL)) { + $extend[] = 'user = ? AND'; + $params[] = $filter['user']; + } + + if(is_numeric($filter['category'] ?? NULL)) { + $extend[] = 'category = ? AND'; + $params[] = $filter['category']; + } + if($limit) { $limit = "LIMIT $offset,$limit"; } -- cgit v1.2.3