diff options
Diffstat (limited to 'app/Models/FeedDAO.php')
| -rw-r--r-- | app/Models/FeedDAO.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index dcabf337b..a2c64977f 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -487,7 +487,8 @@ SQL; $whereEntryIdFeeds = 'id_feed IN (' . str_repeat('?,', count($feedIds) - 1) . '?)'; } $sql = <<<SQL - WITH entry_counts AS ( + UPDATE `_feed` + LEFT JOIN ( SELECT id_feed, COUNT(*) AS total_entries, @@ -495,9 +496,7 @@ SQL; FROM `_entry` WHERE $whereEntryIdFeeds GROUP BY id_feed - ) - UPDATE `_feed` - LEFT JOIN entry_counts ON entry_counts.id_feed = `_feed`.id + ) AS entry_counts ON entry_counts.id_feed = `_feed`.id SET `cache_nbEntries` = COALESCE(entry_counts.total_entries, 0), `cache_nbUnreads` = COALESCE(entry_counts.unread_entries, 0) WHERE $whereFeedIds |
