tp5使用原生sql语句

//记得引入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.'条记录!');

}
posted @ 2021-04-28 13:28  大海啊都是水啊水  阅读(281)  评论(0)    收藏  举报