代码语言:javascript复制原生写法如下
select * from vd_video order by locate(video_type_id,'3,7,6') desc
代码语言:javascript复制Yii中写法如下
$type_ids = '3,7,6';
Video::find()->orderBy([new Expression("locate(video_type_id, '$type_ids')")])->asArray()->all();
代码语言:javascript复制原生写法如下
select * from vd_video order by locate(video_type_id,'3,7,6') desc
代码语言:javascript复制Yii中写法如下
$type_ids = '3,7,6';
Video::find()->orderBy([new Expression("locate(video_type_id, '$type_ids')")])->asArray()->all();