1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-26 01:36:43 +00:00

Update InternalApiController

This commit is contained in:
Daniel Supernault 2020-11-21 19:56:25 -07:00
parent e08f646008
commit f8dc33cc81
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -80,18 +80,25 @@ class InternalApiController extends Controller
});
$following = array_merge($following, $filters);
$sql = config('database.default') !== 'pgsql';
$posts = Status::select(
'id',
'caption',
'is_nsfw',
'profile_id',
'type'
'type',
'uri',
'created_at'
)
->whereNull('uri')
->whereIn('type', ['photo','photo:album', 'video'])
->whereIsNsfw(false)
->whereVisibility('public')
->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')
->inRandomOrder()
->latest()