当前位置:网站首页>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();边栏推荐
- 单调栈-84. 柱状图中最大的矩形
- 单调栈-42. 接雨水
- [rust notes] 09- special types and generics
- Cesium for unreal quick start - simple scenario configuration
- [redis] redis persistent RDB vs AOF (source code)
- [cloud native] introduction and use of feign of microservices
- [MySQL] MySQL Performance Optimization Practice: introduction of database lock and index search principle
- Life cycle of Servlet
- MySQL three logs
- Unity editor expansion - draw lines
猜你喜欢

XPath实现XML文档的查询

JS non Boolean operation - learning notes

Kunlunbase meetup is waiting for you!

UE4 source code reading_ Bone model and animation system_ Animation compression

Unity interactive water ripple post-treatment

I made mistakes that junior programmers all over the world would make, and I also made mistakes that I shouldn't have made

Log4j2 vulnerability recurrence and analysis
![[concurrent programming] concurrent tool class of thread](/img/16/2b4d2b3528b138304a1a3918773ecf.jpg)
[concurrent programming] concurrent tool class of thread

Animation_ IK overview

Alibaba canaladmin deployment and canal cluster Ha Construction
随机推荐
PHP uses foreach to get a value in a two-dimensional associative array (with instances)
Message pack in C deserializes array objects
[updating] wechat applet learning notes_ three
注解简化配置与启动时加载
producer consumer problem
Cloudcompare learning (1) - cloudcompare compilation and common plug-in implementation
UE4 source code reading_ Mobile synchronization
Unity learning notes
Graphics_ Games101/202 learning notes
Talking about: is the HashSet set ordered or disordered /hashset set unique, why can we store elements with the same content
[concurrent programming] synchronization container, concurrent container, blocking queue, double ended queue and work secret
SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time
Es8 async and await learning notes
Notes and bugs generated during the use of h:i:s and y-m-d
Sending and receiving of request parameters
Unity interactive water ripple post-treatment
Allocation exception Servlet
Thymeleaf 404 reports an error: there was unexpected error (type=not found, status=404)
Collection interface
数据库原理期末复习