tp 按指定字段指定顺序排序
$top_list = self::where($where)->column('id');
//排序
$exp = new \think\Db\Expression('field(p.id,' . implode(',', $top_list) . '),p.create_time DESC');
//按指定顺序查询
$publish_list = self::alias('p')
->order($exp)
->select();
...
原创
2020-10-22 11:18:26 ·
1393 阅读 ·
0 评论