@php use App\Traits\Table; @endphp @foreach($data['orders'] as $orders_id => $collect) @foreach($collect as $index => $row) @endforeach @endforeach
รหัสคำสั่งซื้อ พนักงานขาย product_name product_price size_name size_price type_name type_price topping_name topping_price quantity amount รับเงิน ทอนเงิน วันที่คำสั่งซื้อ
{{ $index == 0 ? $row->orders_id : null }} {{ $row->sale_name }} {{ $row->product_name }} {{ $row->product_price }} {{ $row->size_name }} {{ $row->size_price }} {{ $row->type_name }} {{ $row->type_price }} @php $toppings = $data['toppingsGrouped'][$row->orders_detail_id] ?? collect(); $toppingList = $toppings ->map(fn($t) => "{$t->topping_name} ({$t->topping_price})") ->implode(', '); @endphp {{ $toppingList }} @php $tprice = $toppings->sum('topping_price'); @endphp {{ number_format($tprice, 2) }} {{ $row->quantity }} {{ $row->amount }} {{ $row->get_money }} {{ $row->change_money }} {{ $row->created_at }}