//记得引入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.‘条记录!‘);
}
2023-11-11 20:16:46
//记得引入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.‘条记录!‘);
}