Rewrite tabulation #14

Merged
okorpheus merged 43 commits from rewrite-tabulation into master 2024-07-14 05:36:29 +00:00
2 changed files with 10 additions and 1 deletions
Showing only changes of commit 0eebd541a0 - Show all commits

View File

@ -71,6 +71,6 @@ class AppServiceProvider extends ServiceProvider
User::observe(UserObserver::class); User::observe(UserObserver::class);
SeatingLimit::observe(SeatingLimitObserver::class); SeatingLimit::observe(SeatingLimitObserver::class);
#Model::preventLazyLoading(! app()->isProduction()); //Model::preventLazyLoading(! app()->isProduction());
} }
} }

View File

@ -2,7 +2,9 @@
namespace App\Services; namespace App\Services;
use App\Actions\Tabulation\RankAuditionEntries;
use App\Models\Entry; use App\Models\Entry;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
class EntryService class EntryService
@ -33,4 +35,11 @@ class EntryService
return $allEntryIds->contains($entry->id); return $allEntryIds->contains($entry->id);
} }
public function rankOfEntry(string $mode, Entry $entry)
{
$ranker = App::make(RankAuditionEntries::class);
$rankings = $ranker->rank($mode, $entry->audition);
return $rankings->find($entry->id)->rank;
}
} }