📜  排序 laravel 雄辩 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:31.550000             🧑  作者: Mango

代码示例6
$go = $go->sort(function ($a, $b) use ($order) {
  $pos_a = array_search($a->colour, $order);
  $pos_b = array_search($b->colour, $order);
  return $pos_a - $pos_b;
});