我想将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]); 

未解决问题?本站智能推荐: