Merge pull request #1936 from pixelfed/staging

Update StoryController, fix postgres bug
pull/1941/head
daniel 5 years ago committed by GitHub
commit 0adf959a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save