📜  laravel 更新订单字段示例 - PHP 代码示例

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

代码示例1
$order = 1;

$records = Model::all();

foreach($records as $row) {
    $row->order = $order;
    $row->update();
    $order++;
}