当前位置:网站首页>Laravel's own paging query
Laravel's own paging query
2022-04-23 03:03:00 【Stupid little attendant】
1. model layer , It's using paginate();
public function selectWhereJoin($table,$where,$order,$orderBy,$limit,$joinTable,$leftjoin)
{
$datas = DB::table($table)
->leftjoin($joinTable,$leftjoin)
->where($where)
->orderBy($order,$orderBy)
->paginate($limit);
return $datas;
}
2.controller layer
$order = 'ims_tiger_newhu_dmorder.id';
$orderBy = 'desc';
$limit = 10;
$joinTable = 'ims_tiger_newhu_member';
$leftjoin = [['ims_tiger_newhu_member.id','=','ims_tiger_newhu_dmorder.p_id']];
$model = new CooperationPlatformModel();
$datas = $model->selectJoin($this->table,$order,$orderBy,$limit,$joinTable,$leftjoin);
return view('cooperationOrder.duomaiOrderBrowser', ['datas' => $datas]);
3. Front page use , Use it directly {
{ $datas->links() }}

版权声明
本文为[Stupid little attendant]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220630238567.html
边栏推荐
- Navicat premium import SQL file
- L2-006 树的遍历(中后序确定二叉树&层序遍历)
- Basic SQL (VIII) data update operation practice
- 【新版发布】ComponentOne 新增 .NET 6 和 Blazor 平台控件支持
- Introduction and use of openfeign component
- The space between the left and right of the movie ticket seats is empty and cannot be selected
- ele之Table表格的封装
- 《信息系统项目管理师总结》第四章 项目成本管理
- Binary tree
- Opencv combines multiple pictures into video
猜你喜欢

Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (8)

Traversal of l2-006 tree (middle and later order determination binary tree & sequence traversal)

PDH optical transceiver 4-way E1 + 4-way 100M Ethernet 4-way 2m optical transceiver FC single fiber 20km rack type

Summary of interface automation interview questions for software testing

C# WPF UI框架MahApps切换主题

C# 读写二进制文件

Passing object type parameters through openfeign

Development notes of raspberry pie (12): start Advantech industrial control raspberry pie uno-220 Kit (I): introduction and operation of the system

基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客?

AspNetCore配置多环境log4net配置文件
随机推荐
C# WPF UI框架MahApps切换主题
Xamarin效果第二十一篇之GIS中可扩展浮动操作按钮
MYSQL05_ Ordr by sorting, limit grouping, group by grouping
Niuke white moon race 5 [problem solving mathematics field]
Introduction and use of openfeign component
Opencv reads webcam video and saves it locally
Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (7)
Configuring Apache Web services for servers such as Tianyi cloud
MYSQL04_ Exercises corresponding to arithmetic, logic, bit, operator and operator
JS using the parameters of art template
C#语法糖空合并运算符【??】和空合并赋值运算符【 ??=】
Chapter IV project cost management of information system project manager summary
对.NET未来的一点感悟
Deep q-network (dqn)
What is the difference between varchar and char?
ele之Table表格的封装
tf. keras. layers. Conv? D function
Error installing Mongo service 'mongodb server' on win10 failed to start
C#中元组对象Tuple的使用
JS relearning