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
|
const tableNames = this.tableNames
|
||||||
if (field.includes(".")) {
|
if (field.includes(".")) {
|
||||||
const [tableName, column] = field.split(".")
|
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) {
|
if (foundTableName) {
|
||||||
const aliasedTableName = tableName.replace(
|
const aliasedTableName = tableName.replace(
|
||||||
foundTableName,
|
foundTableName,
|
||||||
this.getAlias(foundTableName)
|
this.getAlias(foundTableName)
|
||||||
)
|
)
|
||||||
return `${aliasedTableName}.${column}`
|
field = `${aliasedTableName}.${column}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return field
|
return field
|
||||||
|
|
Loading…
Reference in New Issue