当前位置:网站首页>TP5 order multi condition sort
TP5 order multi condition sort
2022-07-03 08:48:00 【bin9153】
// Single conditional sort
$user = $this->where(['parentId'=>0)->field('userId,userName,userSort,isShow')->order('userSort', 'asc')->select();
// Multiple conditional sorting , You can add one more order
$user = $this->where(['parentId'=>0)->field('userId,userName,userSort,isShow')->order('userSort', 'asc')->order('userId', 'asc')->select();
// Multiple conditional sorting , You can write it all order Inside
$user = $this->where(['parentId'=>0)->field('userId,userName,userSort,isShow')->order('userSort', 'asc')->order('userSort asc,userId asc')->select();
//tp5.1
Db::table('think_user')
->where('status', 1)
->order(['order','id'=>'desc'])
->limit(5)
->select();边栏推荐
- Graphics_ Games101/202 learning notes
- producer consumer problem
- Dom4j遍历和更新XML
- Life cycle of Servlet
- 796 · unlock
- Campus lost and found platform based on SSM, source code, database script, project import and operation video tutorial, Thesis Writing Tutorial
- PHP uses foreach to get a value in a two-dimensional associative array (with instances)
- Es8 async and await learning notes
- VIM learning notes from introduction to silk skating
- JS ternary operator - learning notes (with cases)
猜你喜欢
![[concurrent programming] concurrent tool class of thread](/img/16/2b4d2b3528b138304a1a3918773ecf.jpg)
[concurrent programming] concurrent tool class of thread

100 GIS practical application cases (78) - Multi compliance database design and data warehousing

UE4 source code reading_ Mobile synchronization

22-06-27 Xian redis (01) commands for installing five common data types: redis and redis

Gradle's method of dynamically modifying APK package name

Sending and receiving of request parameters
![[concurrent programming] working mechanism and type of thread pool](/img/51/d21428a7c95c0a5177e8198742e78c.jpg)
[concurrent programming] working mechanism and type of thread pool

UE4 source code reading_ Bone model and animation system_ Animation node

分配异常的servlet

Final review of Database Principles
随机推荐
GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库
[rust notes] 07 structure
[rust notes] 11 practical features
数据库原理期末复习
How does unity fixedupdate call at a fixed frame rate
[audio and video] ijkplayer error code
I made mistakes that junior programmers all over the world would make, and I also made mistakes that I shouldn't have made
Concurrent programming (V) detailed explanation of atomic and unsafe magic classes
[concurrent programming] synchronization container, concurrent container, blocking queue, double ended queue and work secret
XPath实现XML文档的查询
[concurrent programming] working mechanism and type of thread pool
Pit & ADB wireless debugging of vivo real machine debugging
100 GIS practical application cases (78) - Multi compliance database design and data warehousing
First Servlet
[concurrent programming] atomic operation CAS
[rust notes] 08 enumeration and mode
Unity editor expansion - controls, layouts
Constraintlayout's constraintset dynamically modifies constraints
【Rust笔记】02-所有权
PHP uses foreach to get a value in a two-dimensional associative array (with instances)