当前位置:网站首页>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();边栏推荐
- 【Rust 笔记】11-实用特型
- 22-06-27 西安 redis(01) 安装redis、redis5种常见数据类型的命令
- SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time
- Annotations simplify configuration and loading at startup
- Creation of osgearth earth files to the earth ------ osgearth rendering engine series (1)
- XPath实现XML文档的查询
- Notes and bugs generated during the use of h:i:s and y-m-d
- Gif remove blank frame frame number adjustment
- Kunlunbase meetup is waiting for you!
- Concurrent programming (V) detailed explanation of atomic and unsafe magic classes
猜你喜欢

Annotations simplify configuration and loading at startup
![[concurrent programming] thread foundation and sharing between threads](/img/26/60fbfe65b186867a3b1cb58d481226.jpg)
[concurrent programming] thread foundation and sharing between threads

MySQL 8

OpenGL learning notes

Concurrent programming (VI) ABA problems and solutions under CAS
![[rust notes] 02 ownership](/img/f7/74f8ea3bd697957f9ebfa3e1513fda.png)
[rust notes] 02 ownership

GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库

Monotonic stack -503 Next bigger Element II

Concurrent programming (V) detailed explanation of atomic and unsafe magic classes

Simple demo of solving BP neural network by gradient descent method
随机推荐
Unity editor expansion - the framework and context of unity imgui
基于SSM的校园失物招领平台,源码,数据库脚本,项目导入运行视频教程,论文撰写教程
Simple demo of solving BP neural network by gradient descent method
Monotonic stack -42 Connect rainwater
How to delete CSDN after sending a wrong blog? How to operate quickly
MySQL index types B-tree and hash
producer consumer problem
【Rust 笔记】12-闭包
Cloudcompare learning (1) - cloudcompare compilation and common plug-in implementation
[MySQL] MySQL Performance Optimization Practice: introduction of database lock and index search principle
On the difference and connection between find and select in TP5 framework
Transmit pictures with Base64 encoding
Concurrent programming (V) detailed explanation of atomic and unsafe magic classes
Final review of Database Principles
22-06-27 西安 redis(01) 安装redis、redis5种常见数据类型的命令
Allocation exception Servlet
Chocolate installation
Advanced OSG collision detection
Gradle's method of dynamically modifying APK package name
Annotations simplify configuration and loading at startup