diff options
author | Brion Vibber <brion@pobox.com> | 2010-12-17 14:43:45 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-12-17 14:43:45 -0800 |
commit | 3ddfa4de931f4eb3083ac877898b5ee8b03a82f1 (patch) | |
tree | 70895bb45562a6ce9b4020b4fa2105e3542a6468 /classes | |
parent | 00a5a5342ab0c44d59697cded81f6e96ba49c42c (diff) |
Update sorting on reply/mentions timeline: added reply_profile_id_modified_notice_id_idx index to reply table
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Reply.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/classes/Reply.php b/classes/Reply.php index da8a4f685..371c16cf4 100644 --- a/classes/Reply.php +++ b/classes/Reply.php @@ -50,15 +50,10 @@ class Reply extends Memcached_DataObject $reply = new Reply(); $reply->profile_id = $user_id; - if ($since_id != 0) { - $reply->whereAdd('notice_id > ' . $since_id); - } - - if ($max_id != 0) { - $reply->whereAdd('notice_id <= ' . $max_id); - } + Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'modified'); + Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'modified'); - $reply->orderBy('notice_id DESC'); + $reply->orderBy('modified DESC, notice_id DESC'); if (!is_null($offset)) { $reply->limit($offset, $limit); |