/**
  * 执行事务
  *
  * @param  \Closure  $callback
  * @return mixed
  *
  * @throws \Exception|\Throwable
  */
 public function transaction(Closure $callback)
 {
     if ($this->getDriverName() == 'sqlsrv') {
         return parent::transaction($callback);
     }
     $this->getPdo()->exec('BEGIN TRAN');
     try {
         $result = $callback($this);
         $this->getPdo()->exec('COMMIT TRAN');
     } catch (Exception $e) {
         $this->getPdo()->exec('ROLLBACK TRAN');
         throw $e;
     } catch (Throwable $e) {
         $this->getPdo()->exec('ROLLBACK TRAN');
         throw $e;
     }
     return $result;
 }