Skip to content

Commit

Permalink
update 替换底层Connection 在查询事件结束时执行事件将$statement传递出去使用
Browse files Browse the repository at this point in the history
该做法应能解决查询之后不能执行存储过程 & 方便转Json行为
kvnZero committed Dec 4, 2021
1 parent 17e9b92 commit 6a5a400
Showing 3 changed files with 1,244 additions and 0 deletions.
40 changes: 40 additions & 0 deletions app/Event/ApiJson/StatementComplete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php


declare(strict_types=1);
/**
* @author kvnZero
* @contact kvnZero@github.com
* @time 2021/12/4 5:25 下午
*/

namespace App\Event\ApiJson;

class StatementComplete
{
/**
* The database connection instance.
*
* @var \Hyperf\Database\Connection
*/
public $connection;

/**
* The PDO statement.
*
* @var \PDOStatement
*/
public $statement;

/**
* Create a new event instance.
*
* @param \Hyperf\Database\Connection $connection
* @param \PDOStatement $statement
*/
public function __construct($connection, $statement)
{
$this->statement = $statement;
$this->connection = $connection;
}
}
Loading
Oops, something went wrong.

0 comments on commit 6a5a400

Please sign in to comment.