DB::beginTransaction();
$model = new UserWechat();
$model->unionid = 'od13WwfNk64BQ9ME95S-bzuU7j8A';
$model->save();
DB::rollback();
代码如上,没有按照预期回滚,数据插入了数据库中.
执行原生sql如下, 和预期一致!:
start transaction;
insert into user_wechat (unionid) values('od13WwfNk64BQ9ME95S-bzuU7j8A');
rollback;
难道我错了一万年...