summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-12-17 15:28:55 -0800
committerBrion Vibber <brion@pobox.com>2010-12-17 15:28:55 -0800
commit71151b3bc0e1b1d4d560bf296eb0a572485389e8 (patch)
tree63ac12c20377451f7f78a58bd23706cfbe665da0
parentb80151275a8659e241b66e8f8454541d236f2f0e (diff)
Update sorting for User::repeatedByMe() -- currently unused. Likely not ideally indexed yet.
-rw-r--r--classes/User.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/classes/User.php b/classes/User.php
index edbd6bb2e..47bf8a617 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();