@foreach ($records as $key => $criteria) @foreach ($criteria->sub as $sub) @php $personId = data_get($sub->value, '0.person.id'); $key = sprintf('%s-%s', $sub->id, $personId); $inputValue = $sub->value()->where('person_id', $personId)->first()?->real_value; $utility = round($criteria->bobot * $sub->bobot, 3); $real = round($utility * $criteria->real_value, 3); $this->realValueInput[$sub->id . '-' . $personId] = $inputValue; @endphp @endforeach @endforeach
No Kriteria Bobot Nilai Utility Nilai Real Hasil Rank
{{ $key + 1 }} {{ $criteria->criteria_name }} {{ $criteria->bobot }}
{{ $sub->criteria_name }} {{ $sub->bobot }} {{ round($criteria->bobot * $sub->bobot, 3) }} @foreach ($sub->value as $item) @php $this->manyRealValue[$item->person_id] = $item->real_value; @endphp @endforeach {{ $criteria->real_value}} - {{ $real }}