Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
alihardan committed Apr 6, 2024
1 parent 380a728 commit 675d0d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@

$games = Game::whereNull('ia_id')->where('selling', false)
->whereNot('slug', 'grand-theft-auto-san-andreas-oldpersiangames')
->get(['slug', 'tgfiles', 'games', 'collection_title_en'])->map(function ($game) {
->get(['slug', 'tgfiles', 'games', 'title_en'])->map(function ($game) {
$tgfiles = TGFile::whereIn('file_unique_id', $game->tgfiles)->orderByRaw("FIELD(file_unique_id, '" . implode("','", $game->tgfiles) . "')")->get(['file_name', 'file_size', 'file_id', 'file_unique_id', 'date']);
$game->tgfiles = $tgfiles->toArray();

$game->title = $game->collection_title_en ?? $game->games[0]['title_en'][0];
$game->title = $game->title_en ?? $game->games[0]['title_en'][0];
$game->type = 'game';
unset($game->collection_title_en);
unset($game->title_en);
unset($game->games);
return $game;
});
Expand Down

0 comments on commit 675d0d8

Please sign in to comment.