@extends('layouts.report') @section('title', '仕入商品明細一覧表') @section('content') @php $RECORDS_PER_PAGE = 17; $pages = []; $page = []; $total = 0; foreach($viewdata['products'] as $product) { //$total += $payment['money']; $page[] = $product; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('monthlypurchase/productList01-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection