Fixing issue with quotes/graves.

This commit is contained in:
mike12345567 2024-02-28 14:38:43 +00:00
parent aa6fa76618
commit 58e4271440
1 changed files with 4 additions and 2 deletions

View File

@ -57,13 +57,15 @@ export default class AliasTables {
const tableNames = this.tableNames
if (field.includes(".")) {
const [tableName, column] = field.split(".")
const foundTableName = tableNames.find(name => tableName.includes(name))
const foundTableName = tableNames.find(
name => tableName.includes(name) && tableName.indexOf(name) <= 1
)
if (foundTableName) {
const aliasedTableName = tableName.replace(
foundTableName,
this.getAlias(foundTableName)
)
return `${aliasedTableName}.${column}`
field = `${aliasedTableName}.${column}`
}
}
return field