Skip to content

Commit

Permalink
feat: change the condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
ping-yee committed Apr 18, 2024
1 parent d7dd6b4 commit 4ac35c0
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions system/Database/SQLSRV/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,18 +295,16 @@ private function getFullName(string $table): string
$database = $this->db->getDatabase();
$table = $dbInfo[0];

if (count($dbInfo) >= 2 && isset($dbInfo[1])) {
if (count($dbInfo) === 3 && isset($dbInfo[2])) {
$database = str_replace('"', '', $dbInfo[0]);
$schema = str_replace('"', '', $dbInfo[1]);
$tableName = str_replace('"', '', $dbInfo[2]);
} else {
$schema = str_replace('"', '', $dbInfo[0]);
$tableName = str_replace('"', '', $dbInfo[1]);
}

return '"' . $database . '"."' . $schema . '"."' . str_replace('"', '', $tableName) . '"' . $alias;
if (count($dbInfo) === 3) {
$database = str_replace('"', '', $dbInfo[0]);
$schema = str_replace('"', '', $dbInfo[1]);
$tableName = str_replace('"', '', $dbInfo[2]);
} else {
$schema = str_replace('"', '', $dbInfo[0]);
$tableName = str_replace('"', '', $dbInfo[1]);
}

return '"' . $database . '"."' . $schema . '"."' . str_replace('"', '', $tableName) . '"' . $alias;
}

return '"' . $this->db->getDatabase() . '"."' . $this->db->schema . '"."' . str_replace('"', '', $table) . '"' . $alias;
Expand Down

0 comments on commit 4ac35c0

Please sign in to comment.