prodV1 #2

Open
RomanGolienko wants to merge 309 commits from prodV1 into main
1 changed files with 6 additions and 6 deletions
Showing only changes of commit 68ccbf2910 - Show all commits

View File

@ -2,12 +2,12 @@
namespace App\Http\Controllers\Api;
use App\Enums\ExaminationTypeEnum;
use App\Http\Controllers\Controller;
use App\Models\Department;
use App\Models\Direction;
use App\Models\EntranceExamination;
use App\Models\Faculty;
use App\Models\SubjectType;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;
@ -20,7 +20,8 @@ class CalculatorController extends Controller
$countUserSubjects = count($calcultatorSubjects);
$filteredDirectionIds = EntranceExamination::all()
->select("direction_id", "subject_id", "subject_type_id")
->select("direction_id", "subject_id", "subject_type_id", "examination_type_id")
->where('examination_type_id', '=', ExaminationTypeEnum::Ege->value)
->reduce(function (array $carry, $examine) {
[
@ -48,9 +49,8 @@ class CalculatorController extends Controller
$optionalSubjectsInCalculator = collect($subjectTypes[2])
->filter(fn($optionalSubject) => in_array($optionalSubject, $calcultatorSubjects));
return $optionalSubjectsInCalculator->count() !== 0;
})->map(fn ($subjectTypes, $directionId) => $directionId)
;
// dd($result);
})->map(fn($subjectTypes, $directionId) => $directionId);
$directions = Direction::whereIn('id', $result)->get();