注入Query类
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user