mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-23 06:51:27 +00:00
Merge pull request #2444 from pixelfed/staging
Update DiscoverController
This commit is contained in:
commit
5af87c7298
1 changed files with 4 additions and 2 deletions
|
@ -181,11 +181,13 @@ class DiscoverController extends Controller
|
||||||
$ttl = now()->addHours(2);
|
$ttl = now()->addHours(2);
|
||||||
$res = Cache::remember($key, $ttl, function() use($range) {
|
$res = Cache::remember($key, $ttl, function() use($range) {
|
||||||
if($range == '-1') {
|
if($range == '-1') {
|
||||||
$res = Status::orderBy('likes_count','desc')
|
$res = Status::whereVisibility('public')
|
||||||
|
->orderBy('likes_count','desc')
|
||||||
->take(12)
|
->take(12)
|
||||||
->get();
|
->get();
|
||||||
} else {
|
} else {
|
||||||
$res = Status::orderBy('likes_count','desc')
|
$res = Status::whereVisibility('public')
|
||||||
|
->orderBy('likes_count','desc')
|
||||||
->take(12)
|
->take(12)
|
||||||
->where('created_at', '>', now()->subDays($range))
|
->where('created_at', '>', now()->subDays($range))
|
||||||
->get();
|
->get();
|
||||||
|
|
Loading…
Reference in a new issue