Yii2 orderBy FIELD 自定义排序

User::find()->where(['in','id',$fids])->orderBy(["FIELD(id, ".join(',',$uids).")" => true])->all();

原文地址:https://www.cnblogs.com/renren/p/13719185.html