mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update StoryController, fix postgres bug
This commit is contained in:
parent
b0fd75f4c2
commit
8360aa4827
1 changed files with 2 additions and 1 deletions
|
@ -104,11 +104,12 @@ class StoryController extends Controller
|
|||
|
||||
$profile = $request->user()->profile;
|
||||
$following = $profile->following->pluck('id')->toArray();
|
||||
$groupBy = config('database.default') == 'pgsql' ? 'id' : 'profile_id';
|
||||
|
||||
$stories = Story::with('profile')
|
||||
->whereIn('profile_id', $following)
|
||||
->where('expires_at', '>', now())
|
||||
->groupBy('profile_id')
|
||||
->groupBy($groupBy)
|
||||
->orderByDesc('expires_at')
|
||||
->take(9)
|
||||
->get()
|
||||
|
|
Loading…
Reference in a new issue