From fb15a2d8048ff66db5cb73b0dfb3a5b6a052e1db Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 31 Dec 2021 13:10:41 +0100 Subject: Search on article IDs (#4058) * Search on article IDs Partial implementation of https://github.com/FreshRSS/FreshRSS/issues/4053 --- app/Models/EntryDAO.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 86f3ac040..7c133a2f4 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -732,6 +732,29 @@ SQL; } $sub_search = ''; + if ($filter->getEntryIds()) { + foreach ($filter->getEntryIds() as $entry_ids) { + $sub_search .= 'AND ' . $alias . 'id IN ('; + foreach ($entry_ids as $entry_id) { + $sub_search .= '?,'; + $values[] = $entry_id; + } + $sub_search = rtrim($sub_search, ','); + $sub_search .= ') '; + } + } + if ($filter->getNotEntryIds()) { + foreach ($filter->getNotEntryIds() as $entry_ids) { + $sub_search .= 'AND ' . $alias . 'id NOT IN ('; + foreach ($entry_ids as $entry_id) { + $sub_search .= '?,'; + $values[] = $entry_id; + } + $sub_search = rtrim($sub_search, ','); + $sub_search .= ') '; + } + } + if ($filter->getMinDate()) { $sub_search .= 'AND ' . $alias . 'id >= ? '; $values[] = "{$filter->getMinDate()}000000"; -- cgit v1.2.3