From 3b67f3fb5f10cc1fe02127014491a229683cb0e5 Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Mon, 13 Jan 2020 16:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=85=A5Query=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catch/CatchAdminService.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/catch/CatchAdminService.php b/catch/CatchAdminService.php index c5eb240..89c3624 100644 --- a/catch/CatchAdminService.php +++ b/catch/CatchAdminService.php @@ -6,6 +6,7 @@ use catchAdmin\permissions\OperateLogListener; use catchAdmin\permissions\PermissionsMiddleware; use catchAdmin\system\event\LoginLogEvent; use catchAdmin\system\event\OperateLogEvent; +use catcher\CatchQuery; use catcher\command\BackupCommand; use catcher\command\CompressPackageCommand; use catcher\command\CreateModuleCommand; @@ -33,6 +34,7 @@ class CatchAdminService extends Service $this->registerMiddleWares(); $this->registerEvents(); $this->registerListeners(); + $this->registerQuery(); } /** @@ -116,4 +118,15 @@ class CatchAdminService extends Service ], ]); } + + protected function registerQuery() + { + $connections = $this->app->config->get('database.connections'); + + $connections['mysql']['query'] = CatchQuery::class; + + $this->app->config->set([ + 'connections' => $connections + ], 'database'); + } }