$this->RechargeLog->query('START TRANSACTION;'); $this->RechargeLog->query('SET AUTOCOMMIT =0;'); $result = $this->RechargeLog->save($_data); if(!empty($result)){ $result = $this->_rechargeDitch($list['RechargeLog']['type']); if($result){ $this->RechargeLog->query('COMMIT;'); $this->RechargeLog->query('SET AUTOCOMMIT =1;'); }else{ $this->RechargeLog->query('ROLLBACK;'); $this->RechargeLog->query('SET AUTOCOMMIT =1;'); } }else{ $this->RechargeLog->query('ROLLBACK;'); $this->RechargeLog->query('SET AUTOCOMMIT =1;');