diff options
| author | 2021-12-31 13:10:41 +0100 | |
|---|---|---|
| committer | 2021-12-31 13:10:41 +0100 | |
| commit | fb15a2d8048ff66db5cb73b0dfb3a5b6a052e1db (patch) | |
| tree | ac778c9e2175c7bb3b6dcf15cbe6af562c7713b8 /app/Models/EntryDAO.php | |
| parent | afb3035bc6a50b8f6334f2729e3a7f568b429022 (diff) | |
Search on article IDs (#4058)
* Search on article IDs
Partial implementation of https://github.com/FreshRSS/FreshRSS/issues/4053
Diffstat (limited to 'app/Models/EntryDAO.php')
| -rw-r--r-- | app/Models/EntryDAO.php | 23 |
1 files changed, 23 insertions, 0 deletions
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"; |
