mirror of
https://github.com/flarum/core.git
synced 2025-10-18 18:26:07 +02:00
went over most of the changed attributes from the other pr
This commit is contained in:
@@ -23,7 +23,7 @@ class DiscussionSearch extends AbstractSearch
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultSort = ['lastTime' => 'desc'];
|
||||
protected $defaultSort = ['lastPostedAt' => 'desc'];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
@@ -54,6 +54,6 @@ class AuthorGambit extends AbstractRegexGambit
|
||||
$ids[] = $this->users->getIdForUsername($username);
|
||||
}
|
||||
|
||||
$search->getQuery()->whereIn('start_user_id', $ids, 'and', $negate);
|
||||
$search->getQuery()->whereIn('user_id', $ids, 'and', $negate);
|
||||
}
|
||||
}
|
||||
|
@@ -37,9 +37,9 @@ class CreatedGambit extends AbstractRegexGambit
|
||||
// provided with a YYYY-MM-DD..YYYY-MM-DD range, then find discussions
|
||||
// that were started during that period.
|
||||
if (empty($matches[3])) {
|
||||
$search->getQuery()->whereDate('start_time', $negate ? '!=' : '=', $matches[1]);
|
||||
$search->getQuery()->whereDate('created_at', $negate ? '!=' : '=', $matches[1]);
|
||||
} else {
|
||||
$search->getQuery()->whereBetween('start_time', [$matches[1], $matches[3]], 'and', $negate);
|
||||
$search->getQuery()->whereBetween('created_at', [$matches[1], $matches[3]], 'and', $negate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,9 +34,9 @@ class HiddenGambit extends AbstractRegexGambit
|
||||
|
||||
$search->getQuery()->where(function ($query) use ($negate) {
|
||||
if ($negate) {
|
||||
$query->whereNull('hide_time')->where('comments_count', '>', 0);
|
||||
$query->whereNull('hidden_at')->where('comment_count', '>', 0);
|
||||
} else {
|
||||
$query->whereNotNull('hide_time')->orWhere('comments_count', 0);
|
||||
$query->whereNotNull('hidden_at')->orWhere('comment_count', 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -53,9 +53,9 @@ class UnreadGambit extends AbstractRegexGambit
|
||||
|
||||
$search->getQuery()->where(function ($query) use ($readIds, $negate, $actor) {
|
||||
if (! $negate) {
|
||||
$query->whereNotIn('id', $readIds)->where('last_time', '>', $actor->read_time ?: 0);
|
||||
$query->whereNotIn('id', $readIds)->where('last_posted_at', '>', $actor->marked_all_as_read_at ?: 0);
|
||||
} else {
|
||||
$query->whereIn('id', $readIds)->orWhere('last_time', '<=', $actor->read_time ?: 0);
|
||||
$query->whereIn('id', $readIds)->orWhere('last_posted_at', '<=', $actor->marked_all_as_read_at ?: 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user