laravel 按照whereIn中给定数组顺序输出
$ids; // array of ids
$placeholders = implode(',',array_fill(0, count($ids), '?')); // string for the query
Operation::whereIn('id', $ids) ->orderByRaw("field(id,{$placeholders})", $ids)->get();
参考链接:stackoverflow.com/questions/261762...
本作品采用《CC 协议》,转载必须注明作者和本文链接