I want to update all column with 0 value to 1
(我想将0值的所有列更新为1)
Controller
(控制者)
$totalofitem=assets::where('item_name','like','keyboard')
->where('total_cost','like','0')->update(array('total_cost' => '1'));
Got it
(得到它了)
$totalofitem=assets::where('item_name','like','keyboard')
->where('total_cost','like','0')->update(['total_cost' => 1]);
ask by jer translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…