Skip to content

Commit

Permalink
ta inja
Browse files Browse the repository at this point in the history
  • Loading branch information
alihardan committed Oct 8, 2023
1 parent b17d32a commit 4b42d27
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 @@ -45,10 +45,10 @@

$games = Game::whereNull('ia_id')->where('selling', false)
->whereNot('slug', 'grand-theft-auto-san-andreas-oldpersiangames')
->get(['slug', 'tgfiles'])->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', 'games', 'collection_title_en']);
$game->tgfiles = $tgfiles->toArray();
->get(['slug', 'tgfiles', 'games', 'collection_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->title = $game->collection_title_en ?? $game->games[0]['title_en'][0];
$game->tgfiles = $tgfiles->toArray();
unset($game->collection_title_en);
unset($game->games);
return $game;
Expand Down

0 comments on commit 4b42d27

Please sign in to comment.