Fixing issue with quotes/graves.
This commit is contained in:
parent
aa6fa76618
commit
58e4271440
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue