@php($teams=$data['teams']) @if(!$teams->isEmpty()) @foreach($teams as $team) @php($total_task = DB::table('tasks')->where('task_owner', $team->admin_uuid)->where('task_related_to', 'Opportunity')->where('task_linked_with_uuid', $show->opportunity_uuid)->count()) @php($completed_task_stage_uuid = DB::table('task_stage')->where('is_completed', 1)->first()) @php($progress_task_stage_uuid = DB::table('task_stage')->where('is_completed','!=', 1)->first()) @php($completed_task = DB::table('tasks')->where('task_owner', $team->admin_uuid)->where('task_related_to', 'Opportunity')->where('task_linked_with_uuid', $show->opportunity_uuid)->where('task_stage', !empty($completed_task_stage_uuid->record_uuid)?$completed_task_stage_uuid->record_uuid:'')->count()) @php($progress_task = DB::table('tasks')->where('task_owner', $team->admin_uuid)->where('task_related_to', 'Opportunity')->where('task_linked_with_uuid', $show->opportunity_uuid)->where('task_stage', !empty($progress_task_stage_uuid->record_uuid->record_uuid)?$progress_task_stage_uuid->record_uuid->record_uuid:'')) @php($progress_task_count = $progress_task->count()) @php($progress_task_sum = $progress_task->sum('estimated_time_to_complete')) @php($last_task_estimate = $progress_task->orderBy('id', 'desc')->first())
@if(!empty($team->thumbnail) && file_exists('uploads/team/thumbnail/'.$team->thumbnail)) @else @endif
@if(!empty($total_task) && !empty($completed_task)) @php($total_percentage = ($completed_task/$total_task) * 100) @endif
 
{{ !empty($last_task_estimate) ? date('H:i', strtotime($last_task_estimate->task_due_on)) : '00:00' }}
{{ $completed_task }} of {{ $total_task }} done
@if(empty($total_task))
@endif
@endforeach @endif