From e580072cb4dc389d7bb41a1a26a113efa2652b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 28 Apr 2021 10:57:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Command.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Database/Command.php b/Database/Command.php index 34925549..8e5e3712 100644 --- a/Database/Command.php +++ b/Database/Command.php @@ -152,9 +152,7 @@ class Command extends Component if (!($query = $connect?->query($this->sql))) { return $this->addError($connect->errorInfo()[2] ?? '数据库异常, 请稍后再试.'); } - Coroutine::defer(function () use ($query) { - $query->closeCursor(); - }); + defer(fn() => $query->closeCursor()); if ($type === static::FETCH_COLUMN) { return $query->fetchAll(PDO::FETCH_ASSOC); } else if ($type === static::ROW_COUNT) {