kopia lustrzana https://github.com/pixelfed/pixelfed
Update StoryController, fix postgres bug
rodzic
b0fd75f4c2
commit
8360aa4827
|
@ -104,11 +104,12 @@ class StoryController extends Controller
|
||||||
|
|
||||||
$profile = $request->user()->profile;
|
$profile = $request->user()->profile;
|
||||||
$following = $profile->following->pluck('id')->toArray();
|
$following = $profile->following->pluck('id')->toArray();
|
||||||
|
$groupBy = config('database.default') == 'pgsql' ? 'id' : 'profile_id';
|
||||||
|
|
||||||
$stories = Story::with('profile')
|
$stories = Story::with('profile')
|
||||||
->whereIn('profile_id', $following)
|
->whereIn('profile_id', $following)
|
||||||
->where('expires_at', '>', now())
|
->where('expires_at', '>', now())
|
||||||
->groupBy('profile_id')
|
->groupBy($groupBy)
|
||||||
->orderByDesc('expires_at')
|
->orderByDesc('expires_at')
|
||||||
->take(9)
|
->take(9)
|
||||||
->get()
|
->get()
|
||||||
|
|
Ładowanie…
Reference in New Issue