1
0
Fork 0
forked from mirror/pixelfed

Update DiscoverController

This commit is contained in:
Daniel Supernault 2021-01-17 22:02:27 -07:00
parent 234f72f3aa
commit a98b65bf5c
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -144,12 +144,12 @@ class DiscoverController extends Controller
public function profilesDirectoryApi(Request $request)
{
return ['error' => 'Temporarily unavailable.'];
$this->validate($request, [
'page' => 'integer|max:10'
]);
return ['error' => 'Temporarily unavailable.'];
$page = $request->input('page') ?? 1;
$key = 'discover:profiles:page:' . $page;
$ttl = now()->addHours(12);
@ -214,6 +214,8 @@ class DiscoverController extends Controller
public function trendingHashtags(Request $request)
{
return [];
$res = StatusHashtag::select('hashtag_id', \DB::raw('count(*) as total'))
->groupBy('hashtag_id')
->orderBy('total','desc')
@ -234,6 +236,8 @@ class DiscoverController extends Controller
public function trendingPlaces(Request $request)
{
return [];
$res = Status::select('place_id',DB::raw('count(place_id) as total'))
->whereNotNull('place_id')
->where('created_at','>',now()->subDays(14))
@ -250,6 +254,6 @@ class DiscoverController extends Controller
];
});
return $res;
return [];
}
}