mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 16:23:16 +00:00
Merge pull request #2445 from pixelfed/staging
Update InternalApiController
This commit is contained in:
commit
f58e9b6be6
1 changed files with 9 additions and 2 deletions
|
@ -80,18 +80,25 @@ class InternalApiController extends Controller
|
||||||
});
|
});
|
||||||
$following = array_merge($following, $filters);
|
$following = array_merge($following, $filters);
|
||||||
|
|
||||||
|
$sql = config('database.default') !== 'pgsql';
|
||||||
|
|
||||||
$posts = Status::select(
|
$posts = Status::select(
|
||||||
'id',
|
'id',
|
||||||
'caption',
|
'caption',
|
||||||
|
'is_nsfw',
|
||||||
'profile_id',
|
'profile_id',
|
||||||
'type'
|
'type',
|
||||||
|
'uri',
|
||||||
|
'created_at'
|
||||||
)
|
)
|
||||||
->whereNull('uri')
|
->whereNull('uri')
|
||||||
->whereIn('type', ['photo','photo:album', 'video'])
|
->whereIn('type', ['photo','photo:album', 'video'])
|
||||||
->whereIsNsfw(false)
|
->whereIsNsfw(false)
|
||||||
->whereVisibility('public')
|
->whereVisibility('public')
|
||||||
->whereNotIn('profile_id', $following)
|
->whereNotIn('profile_id', $following)
|
||||||
->whereDate('created_at', '>', now()->subMonths(3))
|
->when($sql, function($q, $s) {
|
||||||
|
return $q->where('created_at', '>', now()->subMonths(3));
|
||||||
|
})
|
||||||
->with('media')
|
->with('media')
|
||||||
->inRandomOrder()
|
->inRandomOrder()
|
||||||
->latest()
|
->latest()
|
||||||
|
|
Loading…
Reference in a new issue