Waiting list Table

Waiting list

@php $row_index =0; @endphp @forelse ($order_details as $key =>$order_detail) @php $prev_level_ids = \App\Models\CourseLevel::find($order_detail->course_level_id)->product->course_levels()->where("level_order" ,"<", \App\Models\CourseLevel::find($order_detail->course_level_id)->level_order)->pluck("id"); // skip if the customer has previous levels waiting or open $first_od =\App\Models\OrderDetail::where("customer_id",$order_detail->customer_id)->whereIn("status" ,["waiting","open"])->whereIn("course_level_id" , $prev_level_ids)->first(); if ($first_od){ continue; }else{ $row_index++; } @endphp @empty @endforelse

#

Branch

Period

Course Level

Created At

Name

Code

Mobile

Opened By

{{$row_index}}

{{($order_detail->branch_id)? \App\Models\Branch::find($order_detail->branch_id)->name : '-'}}

{{($order_detail->period_id)? $order_detail->period->name :"" }}

{{($order_detail->course_level_id)? \App\Models\CourseLevel::find($order_detail->course_level_id)->product->name .'-'. \App\Models\CourseLevel::find($order_detail->course_level_id)->name : '-'}}

{{($order_detail->created_at)? date_format(date_create($order_detail->created_at),'Y-m-d') : '-'}}

{{($order_detail->customer_id)? \App\Models\Customer::find($order_detail->customer_id)->name : '-'}}

{{($order_detail->customer_id)? \App\Models\Customer::find($order_detail->customer_id)->code : '-'}}

{{($order_detail->customer_id) ? \App\Models\Customer::find($order_detail->customer_id)->mobile : '-'}}

{{($order_detail->customer_id)? (\App\Models\User::find(\App\Models\Customer::find($order_detail->customer_id)->opened_by_user))? \App\Models\User::find(\App\Models\Customer::find($order_detail->customer_id)->opened_by)->name : '-' : '-'}}

Empty Result