{{-- バランス値の設定 --}}
@php
$balance_total = 100;
@endphp
@foreach($member_structures AS $member_structure)
{{-- 職員名 --}}
@if($loop->first)
{{sprintf('%s %s', $member_structure->last_name, $member_structure->first_name)}}
@endif
{{-- 既存のバランス値を表示 --}}
@if($member_structure->team_member_id)
{{-- 既存のバランス値で減算 --}}
@php
$balance_total -= $member_structure->team_balance;
@endphp
@include('team.partial.team_balance_structure',
array(
'team_name' => $member_structure->team_name,
'team_balance' => $member_structure->team_balance,
'member_id' => $key,
'team_id' => $member_structure->team_id
)
)
@endif
@endforeach
{{-- 新規追加分を表示 --}}
@if(!$isDelete && in_array($key, $member_ids))
@include('team.partial.team_balance_structure',
array(
'team_name' => $current_team_name,
'team_balance' => $balance_total,
'member_id' => $key,
'team_id' => $current_team_id
)
)
@endif
@endforeach