From: Brion Vibber Date: Fri, 17 Dec 2010 23:28:55 +0000 (-0800) Subject: Update sorting for User::repeatedByMe() -- currently unused. Likely not ideally index... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=71151b3bc0e1b1d4d560bf296eb0a572485389e8;p=quix0rs-gnu-social.git Update sorting for User::repeatedByMe() -- currently unused. Likely not ideally indexed yet. --- diff --git a/classes/User.php b/classes/User.php index edbd6bb2e3..47bf8a6177 100644 --- a/classes/User.php +++ b/classes/User.php @@ -755,19 +755,14 @@ class User extends Memcached_DataObject $notice->profile_id = $this->id; $notice->whereAdd('repeat_of IS NOT NULL'); - $notice->orderBy('id DESC'); + $notice->orderBy('created DESC, id DESC'); if (!is_null($offset)) { $notice->limit($offset, $limit); } - if ($since_id != 0) { - $notice->whereAdd('id > ' . $since_id); - } - - if ($max_id != 0) { - $notice->whereAdd('id <= ' . $max_id); - } + Notice::addWhereSinceId($notice, $since_id); + Notice::addWhereMaxId($notice, $max_id); $ids = array();