$md=new Model(); //创建事务
$md->startTrans(); //开始事务
$md->table("ym_xxx")->where("id='123'")->data([ 'name'=>$name ])->save(); $md->commit(); //提交事务$md->rollback(); //回滚