thinkphp、トランザクション ロールバック
function test(){
$withdraw = M('Withdraw');
$withdraw->startTrans();
$data['agent_id' ] =1;
$data['money']=1222;
$withdraw->add($data);
$withdraw->rollback();
}
-----解決策---------
データは挿入されるべきではありませんでした。 $withdraw->rollback();
------解決策------------------
$withdraw->startTrans();
$withdraw = M('Withdraw');
$withdraw->add($data);
if(success){
$withdraw- >commit();
}else{
$withdraw->rollback();
}
//////////////// ////////////////////