当前位置:网站首页>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
边栏推荐
- Encapsulate components such as pull-down menu based on ele
- tf. keras. layers. Inputlayer function
- Specific field information of MySQL export table (detailed operation of Navicat client)
- tf. keras. layers. Density function
- Guangcheng cloud service can fill in a daily report regularly every day
- Microservices (distributed architecture)
- REINFORCE
- [format] simple output (2)
- Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (7)
- L2-006 樹的遍曆(中後序確定二叉樹&層序遍曆)
猜你喜欢
Depth deterministic strategy gradient (ddpg)
基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客?
Kubernetes study notes
Detailed explanation of distributed things
Some problems encountered in setting Django pure interface, channel and MySQL on the pagoda panel
Summary of software test interview questions
Cherno_ Game engine series tutorial (5): 101~
最通俗易懂的依赖注入之生命周期
Assembly learning Chapter III of assembly language (Third Edition) written by Wang Shuang
AC & A2C & A3C
随机推荐
《信息系統項目管理師總結》第六章 項目人力資源管理
Typescript Learning Guide
【新版发布】ComponentOne 新增 .NET 6 和 Blazor 平台控件支持
Numpy append function
AOT和单文件发布对程序性能的影响
tf. keras. layers. Embedding function
Dynamic sequence table + OJ
.Net Core 限流控制-AspNetCoreRateLimit
c#语法糖模式匹配【switch 表达式】
The express project changes the jade template to art template
tf. keras. layers. MaxPooling? D function
Blazor University (12)组件 — 组件生命周期
【鉴权/授权】自定义一个身份认证Handler
MAUI初体验:爽
Chapter VII project communication management of information system project manager summary
tf. keras. layers. Timedistributed function
When using art template inheritance, compileerror: invalid or unexpected token generated
Use of MySQL command line client and common commands
Résumé du gestionnaire de projet du système d'information Chapitre VI gestion des ressources humaines du projet
C#中元组对象Tuple的使用