src/DdvUtil/Laravel/Proxy/Traits/TransactionQuque.php
public function pushTransactionModel($model)
    {
        if (!$this->isRunTransactionQuque){
            // 并没有运行事物，所以无需启动事物
            return $this;
        }
        if (is_array($model)){
            foreach ($model as $m){
                $this->pushTransactionModel($m);
            }
            return $this;
        } elseif (is_object($model)){
            if ($model instanceof Model){
                $connection = $model->getConnection();
            }else{
                throw new ProxyExceptions('must extends abstract Model', 'MUST_EXTENDS_ABSTRACT_MODEL');
            }
        }elseif (is_string($model) && class_exists($model) && method_exists($model, 'getConnection')){
            /**
             * ConnectionInterface $connection
             */
            $connection = (new $model())->getConnection();
        }
        if (is_object($connection) && method_exists($connection,'beginTransaction')){
            if (!in_array($connection, $this->transactionConnections, true)){
                $connection->beginTransaction();
                $this->transactionConnections[] = $connection;
            }
            return $this;
        }else{
            throw new ProxyExceptions('Invalid connection', 'INVALID_CONNECTION');
        }
    }
public function pushTransactionModel($model)
    {
        if (!$this->isRunTransactionQuque){
            // 并没有运行事物，所以无需启动事物
            return $this;
        }
        if (is_array($model)){
            foreach ($model as $m){
                $this->pushTransactionModel($m);
            }
            return $this;
        } elseif (is_object($model)){
            if ($model instanceof Model){
                $connection = $model->getConnection();
            }else{
                throw new ProxyExceptions('must extends abstract Model', 'MUST_EXTENDS_ABSTRACT_MODEL');
            }
        }elseif (is_string($model) && class_exists($model) && method_exists($model, 'getConnection')){
            /**
             * ConnectionInterface $connection
             */
            $connection = (new $model())->getConnection();
        }
        if (is_object($connection) && method_exists($connection,'beginTransaction')){
            if (!in_array($connection, $this->transactionConnections, true)){
                $connection->beginTransaction();
                $this->transactionConnections[] = $connection;
            }
            return $this;
        }else{
            throw new ProxyExceptions('Invalid connection', 'INVALID_CONNECTION');
        }
    }
插入需要开启事物的model
@param Model[]|Model|array|string $model
@return $this
@throws ProxyExceptions
@throws \Exception