mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-04 02:14:06 +02:00
19 lines
489 B
PHP
19 lines
489 B
PHP
<?php namespace Demostf\API\Providers;
|
|
|
|
class InfoProvider extends BaseProvider {
|
|
public function listMaps() {
|
|
$sql = 'SELECT DISTINCT(map), COUNT(map) AS count from demos GROUP BY map ORDER BY count DESC';
|
|
$result = $this->query($sql);
|
|
return $result->fetchAll(\PDO::FETCH_COLUMN);
|
|
}
|
|
|
|
public function getStats() {
|
|
$demoCount = $this->db->demo()->count();
|
|
$playerCount = $this->db->user()->count();
|
|
|
|
return [
|
|
'demos' => $demoCount,
|
|
'players' => $playerCount
|
|
];
|
|
}
|
|
}
|