Update PublicApiController.php

pull/6334/head
Shlee 1 day ago committed by GitHub
parent eecf460e9e
commit 0722244bd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -141,25 +141,22 @@ class PublicApiController extends Controller
$scope = ['public', 'unlisted'];
}
if ($request->filled('min_id') || $request->filled('max_id')) {
if ($request->filled('min_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
->whereIn('scope', $scope)
->select('id', 'caption', 'local', 'visibility', 'scope', 'is_nsfw', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '>=', $request->min_id)
->orderBy('id', 'desc')
->paginate($limit);
}
if ($request->filled('max_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
->whereIn('scope', $scope)
->select('id', 'caption', 'local', 'visibility', 'scope', 'is_nsfw', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '<=', $request->max_id)
->orderBy('id', 'desc')
->paginate($limit);
}
if ($request->filled('min_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
->whereIn('scope', $scope)
->select('id', 'caption', 'local', 'visibility', 'scope', 'is_nsfw', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '>=', $request->min_id)
->orderBy('id', 'desc')
->paginate($limit);
} elseif ($request->filled('max_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
->whereIn('scope', $scope)
->select('id', 'caption', 'local', 'visibility', 'scope', 'is_nsfw', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '<=', $request->max_id)
->orderBy('id', 'desc')
->paginate($limit);
} else {
$replies = Status::whereInReplyToId($status->id)
->whereNull('reblog_of_id')

Loading…
Cancel
Save