当前位置:网站首页>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();
边栏推荐
- Transmit pictures with Base64 encoding
- 【Rust 笔记】10-操作符重载
- Creation and content of mapnode -- osgearth rendering engine series (2)
- [concurrent programming] atomic operation CAS
- First Servlet
- 【Rust 笔记】13-迭代器(上)
- Unity notes 1
- Mxone Pro adaptive 2.0 film and television template watermelon video theme apple cmsv10 template
- How does unity fixedupdate call at a fixed frame rate
- How to place the parameters of the controller in the view after encountering the input textarea tag in the TP framework
猜你喜欢
[concurrent programming] thread foundation and sharing between threads
Monotonic stack -42 Connect rainwater
VIM learning notes from introduction to silk skating
Advanced OSG collision detection
OpenGL learning notes
Explain sizeof, strlen, pointer, array and other combination questions in detail
Deep parsing JVM memory model
Query XML documents with XPath
Animation_ IK overview
UE4 source code reading_ Bone model and animation system_ Animation process
随机推荐
PHP mnemonic code full text 400 words to extract the first letter of each Chinese character
How does unity fixedupdate call at a fixed frame rate
Monotonic stack -503 Next bigger Element II
Final review of Database Principles
[concurrent programming] concurrent security
Unity Editor Extension - Outline
Osgearth starry background
Unity Editor Extension - event handling
Swagger document configuration
XPath实现XML文档的查询
[rust notes] 02 ownership
[MySQL] MySQL Performance Optimization Practice: introduction of database lock and index search principle
单调栈-503. 下一个更大元素 II
MySQL 8
Message queue for interprocess communication
Sequence of map implementation classes
Collection interface
Animation_ IK overview
22-05-26 西安 面试题(01)准备
基于SSM的校园失物招领平台,源码,数据库脚本,项目导入运行视频教程,论文撰写教程