Skip to content

Commit

Permalink
Merge pull request #91 from fwdms/admin_events_fix
Browse files Browse the repository at this point in the history
Admin events fix
  • Loading branch information
krlmrr committed Aug 19, 2023
2 parents 594b9b4 + fb22d29 commit 264ecb0
Show file tree
Hide file tree
Showing 37 changed files with 2,319 additions and 1,488 deletions.
1 change: 1 addition & 0 deletions .phplint-cache

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions app/Http/Controllers/ConstructorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ public function show(Franchise $franchise, string $slug): Response
->with('results')
->first();

/** @var Constructor $team */
$drivers = Driver::query()
->where('constructor_id', $team->id)
->with('results')
->withSum('results', 'points_for_race')
->orderBy('results_sum_points_for_race', 'DESC')
->get();

$drivers_Ids = $drivers->pluck('id');

$results = Result::query()
->whereIn('driver_id', $drivers_Ids)
->whereIn('driver_id', $drivers->pluck('id'))
->with('Race')
->with('Driver')
->orderBy(
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/DriverController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function index(Franchise $franchise): Response
{
$constructors = Constructor::query()
->where('franchise_id', $franchise->id)
->with('drivers')
->with(['drivers', 'results'])
->with('results')
->withSum('results', 'points_for_race')
->orderBy('results_sum_points_for_race', 'DESC')
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^6.1",
"nunomaduro/larastan": "^2.0",
"overtrue/phplint": "^5.3",
"pestphp/pest": "^1.20",
"pestphp/pest-plugin-parallel": "^1.0",
"phpunit/phpunit": "^9.3.3"
Expand Down
Loading

0 comments on commit 264ecb0

Please sign in to comment.