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 { dataSource } from "../data-source";
|
||||||
import { ConditionStructure, DynamicQueryStructure, FieldType, QueryResult } from "../type/dynamicQueries";
|
import { ConditionStructure, DynamicQueryStructure, FieldType, QueryResult } from "../type/dynamicQueries";
|
||||||
import { TableMeta } from "../type/tableMeta";
|
import { TableMeta } from "../type/tableMeta";
|
||||||
|
@ -63,7 +63,7 @@ export default abstract class DynamicQueryBuilder {
|
||||||
count?: number;
|
count?: number;
|
||||||
noLimit?: boolean;
|
noLimit?: boolean;
|
||||||
}): SelectQueryBuilder<ObjectLiteral> {
|
}): 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}`);
|
let query = dataSource.getRepository(queryObj.table).createQueryBuilder(`${affix}_${queryObj.table}`);
|
||||||
|
|
||||||
this.buildDynamicQuery(query, queryObj, affix);
|
this.buildDynamicQuery(query, queryObj, affix);
|
||||||
|
@ -116,7 +116,7 @@ export default abstract class DynamicQueryBuilder {
|
||||||
|
|
||||||
if (queryObject.join) {
|
if (queryObject.join) {
|
||||||
for (const join of 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 == undefined) join.type = "defined";
|
||||||
if (join.type == "defined") {
|
if (join.type == "defined") {
|
||||||
query.innerJoin(`${alias}.${join.foreignColumn}`, `${subaffix}_${join.table}`);
|
query.innerJoin(`${alias}.${join.foreignColumn}`, `${subaffix}_${join.table}`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue