[RSS Feed/News] Slightly inefficient query in XF\Service\Report\ClosureNotifier::determineNotifiableUserIds

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
The query which gets the list of user ids can just just a DISTINCT to avoid fetching more rows than needed, and probably can filter out user_id = 0 in the query itself.

ie something like;
PHP:

Code:
return $db->fetchAllColumn("
   SELECT distinct user_id
   FROM xf_report_comment
   WHERE report_id = ?
      AND comment_date >= ?
      AND is_report = 1
     AND user_id <> 0
", [$reportId, (int)$lastOpenDate]);

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom