Skip to content

Commit

Permalink
Pint 🍻
Browse files Browse the repository at this point in the history
  • Loading branch information
blt950 committed Sep 12, 2023
1 parent a92d5a2 commit c47a02b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions app/Console/Commands/UpdateMemberData.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function handle()

$optionalUserIdFilter = $this->argument('user');

if(!$optionalUserIdFilter) {
if (! $optionalUserIdFilter) {
$users = User::query()->where('refresh_token', '!=', null)->get();
} else {
$users = User::findOrFail($optionalUserIdFilter);
Expand All @@ -62,7 +62,6 @@ public function handle()
if (Carbon::parse($user->token_expires)->isPast()) {

$refresh = $this->oauthHelper->refreshToken($user);


if (! $refresh) {

Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/API/StudentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ class StudentsController extends Controller
{
public function index()
{
$data = [];
$data = [];
$areas = Area::all();
foreach($areas as $area){

foreach ($areas as $area) {
$data[$area->name] = [];

$ratings = $area->ratings->whereNotNull('vatsim_rating');

foreach($ratings as $rating){
foreach ($ratings as $rating) {
$data[$area->name][$rating->name] = [];

$userIds = $rating->trainings->where('status', '>=', 1)->where('area_id', $area->id)->pluck('user.id');
if($userIds->count()){
if ($userIds->count()) {
$data[$area->name][$rating->name] = $userIds->toArray();
}
}
}

return response()->json(['data' => [
$data
$data,
]], 200);
}
}

0 comments on commit c47a02b

Please sign in to comment.