diff options
author | Thomas Lange <code@nerdmind.de> | 2021-07-22 22:44:34 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-07-22 22:44:34 +0200 |
commit | 27e7a426b1c7ba7ec878204a937a0ecfff5214ed (patch) | |
tree | f6095b189b3d7d0b27eff41930d243f161870e91 /core/namespace | |
parent | 8662f123d781a6df4eb5bd05b3556cca94fcf334 (diff) | |
download | blog-27e7a426b1c7ba7ec878204a937a0ecfff5214ed.tar.gz blog-27e7a426b1c7ba7ec878204a937a0ecfff5214ed.tar.xz blog-27e7a426b1c7ba7ec878204a937a0ecfff5214ed.zip |
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.
Diffstat (limited to 'core/namespace')
-rw-r--r-- | core/namespace/ORM/RepositorySearch.php | 10 |
1 files changed, 10 insertions, 0 deletions
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"; } |