【发布时间】:2019-08-29 11:16:30
【问题描述】:
对不起,我的 laravel 分页有问题 例如,在我的表 16 行中,我进行分页 (10),分页在第一页从 1 到 10 给我,并且在从 1 到 6 的第二页中,我想要从 1 到 10 以及从 11 到 16 的正常分页,请提供帮助
public function allappointmnts(){
$allapo=DB::table('bookappoitments')->orderBy('times.id')
->join('users','bookappoitments.users_id','users.id')
->join('times','bookappoitments.times_id','times.id')
->join('dates','bookappoitments.Dates_id','dates.id')
->paginate(10);
return view('admin.Managers.allappoinments',compact('allapo'));
}
在刀片页面中:
<div class="text-center">
{!! $allapo->links(); !!}
</div>
桌子:
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Time</th>
<th>Employee</th>
<th>Name</th>
<th>Email</th>
<th>Company</th>
<th>Phone</th>
<th>Location</th>
<th>Remarks</th>
<th style="text-align: center;">Action</th>
</tr>
</thead>
<tbody>
<tr>
@foreach($allapo as $Appointments)
<td>{{ $loop->index+1 }}</td>
<td>{{ $Appointments->Dates }}</td>
<td>{{ $Appointments->from_to }}</td>
<td>{{ $Appointments->name }}</td>
<td>{{ $Appointments->gustname }}</td>
<td>{{ $Appointments->gustemail }}</td>
<td>{{ $Appointments->gustcompany }}</td>
<td>{{ $Appointments->gustphone }}</td>
<td>{{ $Appointments->Location }}</td>
<td>{{ $Appointments->Remarks }}</td>
<td>
<a class="btn btn-success btn-mini deleteRecord " href="{{url('showbymanagment',$Appointments->id)}}">Show</a>
</td>
</tr>
@endforeach
【问题讨论】:
-
您确定第二页实际上没有加载 11-16 元素..?这里没有什么要说明的。
-
是的,我相信我无法想象 :)
-
你能展示一些截图吗?
-
好的,只是秒