0

我想将所有值为 0 的列更新为 1

控制器

$totalofitem=assets::where('item_name','like','keyboard')
->where('total_cost','like','0')->update(array('total_cost' => '1'));

知道了

$totalofitem=assets::where('item_name','like','keyboard')
->where('total_cost','like','0')->update(['total_cost' => 1]);
4

0 回答 0