patches v1.5.4 #104
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Brackets, DataSource, NotBrackets, ObjectLiteral, SelectQueryBuilder, WhereExpressionBuilder } from "typeorm";
|
||||
import { Brackets, NotBrackets, ObjectLiteral, SelectQueryBuilder, WhereExpressionBuilder } from "typeorm";
|
||||
import { dataSource } from "../data-source";
|
||||
import { ConditionStructure, DynamicQueryStructure, FieldType, QueryResult } from "../type/dynamicQueries";
|
||||
import { TableMeta } from "../type/tableMeta";
|
||||
|
@ -63,7 +63,7 @@ export default abstract class DynamicQueryBuilder {
|
|||
count?: number;
|
||||
noLimit?: boolean;
|
||||
}): SelectQueryBuilder<ObjectLiteral> {
|
||||
let affix = queryObj.id ?? StringHelper.random(10);
|
||||
let affix = queryObj.id.replaceAll("-", "") ?? StringHelper.random(10);
|
||||
let query = dataSource.getRepository(queryObj.table).createQueryBuilder(`${affix}_${queryObj.table}`);
|
||||
|
||||
this.buildDynamicQuery(query, queryObj, affix);
|
||||
|
@ -116,7 +116,7 @@ export default abstract class DynamicQueryBuilder {
|
|||
|
||||
if (queryObject.join) {
|
||||
for (const join of queryObject.join) {
|
||||
let subaffix = join.id ?? StringHelper.random(10);
|
||||
let subaffix = join.id.replaceAll("-", "") ?? StringHelper.random(10);
|
||||
if (join.type == undefined) join.type = "defined";
|
||||
if (join.type == "defined") {
|
||||
query.innerJoin(`${alias}.${join.foreignColumn}`, `${subaffix}_${join.table}`);
|
||||
|
|
Loading…
Add table
Reference in a new issue