//记得引入use/think/Db;
public function change_limit_switch(){
$sql=‘update elephone_reservation set limit_switch = replace(limit_switch,0,1)‘;
$res=Db::execute($sql);
return json_encode(‘执行成功,修改了‘.$res.‘条记录!‘);
}
原文:https://www.cnblogs.com/wakaka623/p/14713700.html