Laravel: order by where in

前端 未结 3 1798
盖世英雄少女心
盖世英雄少女心 2020-12-08 04:59

I am using SphinxSearch to query some contents and have the ids of my objects that I want to query with MySQL. The array of my ids are sorted depending on their rank Sphinx

3条回答
  •  执笔经年
    2020-12-08 05:27

    $category_id = Category::select('id')->orderby('name','ASC')->get()->pluck('id')->toArray();
    

提交回复
热议问题