Skip to content

Commit

Permalink
Merge branch 'main' into remove-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
edersoares committed Jun 2, 2023
2 parents 7ad630c + d7f0e47 commit c88d007
Show file tree
Hide file tree
Showing 13 changed files with 407 additions and 322 deletions.
13 changes: 13 additions & 0 deletions app/Models/Builders/LegacySchoolClassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,23 @@

namespace App\Models\Builders;

use App\Models\DeficiencyType;
use Illuminate\Support\Collection;

class LegacySchoolClassBuilder extends LegacyBuilder
{
public function whereDifferentStudents($schoolClass): self
{
return $this->whereKey($schoolClass)
->whereHas('enrollments', function ($q) {
$q->whereValid();
$q->whereHas('registration', function ($q) {
$q->active();
$q->whereHas('student.individual.deficiency', fn ($q) => $q->where('desconsidera_regra_diferenciada', false)->where('deficiency_type_id', DeficiencyType::DEFICIENCY));
});
});
}

/**
* Retorna o recurso para os selects dos formulários
*
Expand Down
11 changes: 2 additions & 9 deletions app/Models/LegacyEvaluationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Traits\LegacyAttribute;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;

Expand Down Expand Up @@ -94,21 +95,13 @@ public function conceptualRoundingTable()
}

/**
* @return HasOne
* @return BelongsTo
*/
public function deficiencyEvaluationRule()
{
return $this->belongsTo(__CLASS__, 'regra_diferenciada_id');
}

/**
* @return HasOne
*/
public function deficiencyEvaluationRules()
{
return $this->hasMany(__CLASS__, 'regra_diferenciada_id');
}

/**
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ankurk91/laravel-eloquent-relationships": "^1.3",
"aws/aws-sdk-php-laravel": "^3.7",
"composer/semver": "^3.2",
"dex/composer-plug-and-play": "^0.16",
"dex/composer-plug-and-play": "^0.18",
"dex/frontier": "^0.5.0",
"doctrine/dbal": "^3.3",
"google/recaptcha": "^1.2",
Expand Down
Loading

0 comments on commit c88d007

Please sign in to comment.