您的位置:首页 > 编程语言 > PHP开发

Laravel5.4手动创建分页

2017-12-01 18:44 357 查看
$page = $request->input("page",1)-1;
$perPage  = $this->getPerPage();
$total1 = DB::connection('')->table('')->whereRaw($direct_where)->count();
$total2 = DB::connection('')->table('')->whereRaw($book_where)->count();
$total=$total1+$total2;
$booth_book_order=DB::connection('')->table('')->select('')->whereRaw($book_where);

$book_direct_sum_order = DB::connection('')->table('')->select('')->whereRaw($direct_where)->unionAll($booth_book_order)->skip($page*$perPage)->take($perPage)->get();
$content = new LengthAwarePaginator($book_direct_sum_order, $total,$perPage);
//$content= $person->withPath("");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: