This commit is contained in:
2023-04-02 20:09:40 +08:00
parent 0f28608180
commit 735c077f46
+7
View File
@@ -186,8 +186,15 @@ class Connection extends Component
*/
public function getPdo(): PDO
{
if (!Db::inTransactionsActive()) {
return $this->getMasterClient();
}
if (!Context::hasContext($this->cds)) {
return Context::setContext($this->cds, $this->getMasterClient());
} else {
return Context::getContext($this->cds);
}
}
/**
* @return $this|bool