记laravel order by 问题

向wherey一样直接在order 后面再加一层order

例子:

\App\Models\Goods::from('goods as g')->select('*')-orderBy('g.sort_order', 'desc')->offset($begin)->limit($size)->get()->toArray();

\App\Models\Goods::from('goods as g')->select('*')->orderBy('g.sort_order', 'desc')->orderBy('g.goods_id', 'desc')->offset($begin)->limit($size)->get()->toArray();

上一篇:Django学习笔记(12)基于前后端分离模式-添加用例接口实现


下一篇:sql:除非另外还指定了 TOP 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询