@@ -106,10 +106,11 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | public function getServersForUser(int $userId) |
| 108 | 108 | { |
| 109 | - $qb = QueryBuilder::for(Server::class) |
|
| 110 | - ->allowedFilters('ds_id') |
|
| 109 | + $qb = QueryBuilder::for(Server::class) { |
|
| 110 | + ->allowedFilters('ds_id') |
|
| 111 | 111 | ->with('game:code,name,engine,engine_version') |
| 112 | 112 | ->whereRaw('id IN(SELECT server_id FROM server_user su WHERE su.user_id = ?)', [$userId]); |
| 113 | + } |
|
| 113 | 114 | |
| 114 | 115 | return $qb->get([ |
| 115 | 116 | 'id', |
@@ -132,10 +133,11 @@ discard block |
||
| 132 | 133 | |
| 133 | 134 | public function getAllServers() |
| 134 | 135 | { |
| 135 | - $qb = QueryBuilder::for(Server::class) |
|
| 136 | - ->allowedFilters('ds_id') |
|
| 136 | + $qb = QueryBuilder::for(Server::class) { |
|
| 137 | + ->allowedFilters('ds_id') |
|
| 137 | 138 | ->allowedAppends(['full_path', 'is_online']) |
| 138 | 139 | ->with('game:code,name,engine,engine_version'); |
| 140 | + } |
|
| 139 | 141 | |
| 140 | 142 | return $qb->get([ |
| 141 | 143 | 'id', |