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'); + } }