новый лендинг
This commit is contained in:
@@ -277,6 +277,20 @@ class AzerothCoreAccountService
|
||||
return (int) config('moonwell.registration.realm_id', -1);
|
||||
}
|
||||
|
||||
public function onlinePlayerCount(): ?int
|
||||
{
|
||||
try {
|
||||
return (int) $this->charactersConnection()
|
||||
->table('characters')
|
||||
->where('online', 1)
|
||||
->count();
|
||||
} catch (\Throwable $exception) {
|
||||
report($exception);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private function authConnection()
|
||||
{
|
||||
return DB::connection(config('moonwell.auth_connection'));
|
||||
|
||||
@@ -17,6 +17,18 @@ class NewsService
|
||||
return News::query()->ordered()->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection<int, \App\Models\News>
|
||||
*/
|
||||
public function listForLanding(int $limit = 6): Collection
|
||||
{
|
||||
return News::query()
|
||||
->published()
|
||||
->ordered()
|
||||
->limit($limit)
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{total: int, published: int, draft: int}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user