记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();

posted @ 2020-11-16 15:56  Liiu  阅读(285)  评论(0编辑  收藏  举报