fix: 修复一处mysql的filter深层调用节点表达式时会出现的bug
This commit is contained in:
parent
66215811fc
commit
8f0319c648
|
|
@ -872,8 +872,10 @@ class MySqlTranslator extends sqlTranslator_1.SqlTranslator {
|
|||
const refId = (expr)['#refId'];
|
||||
const refAttr = (expr)['#refAttr'];
|
||||
(0, assert_1.default)(refDict[refId]);
|
||||
const attrText = `\`${refDict[refId][0]}\`.\`${refAttr}\``;
|
||||
result = this.translateAttrInExpression(entity, (expr)['#refAttr'], attrText);
|
||||
const [refAlias, refEntity] = refDict[refId];
|
||||
const attrText = `\`${refAlias}\`.\`${refAttr}\``;
|
||||
// 这里必须使用refEntity,否则在filter深层嵌套节点表达式时会出现entity不对应
|
||||
result = this.translateAttrInExpression(refEntity, (expr)['#refAttr'], attrText);
|
||||
}
|
||||
else {
|
||||
(0, assert_1.default)(k.length === 1);
|
||||
|
|
|
|||
|
|
@ -971,8 +971,10 @@ export class MySqlTranslator<ED extends EntityDict & BaseEntityDict> extends Sql
|
|||
const refAttr = (expr)['#refAttr'];
|
||||
|
||||
assert(refDict[refId]);
|
||||
const attrText = `\`${refDict[refId][0]}\`.\`${refAttr}\``;
|
||||
result = this.translateAttrInExpression(entity, (expr)['#refAttr'], attrText);
|
||||
const [refAlias, refEntity] = refDict[refId];
|
||||
const attrText = `\`${refAlias}\`.\`${refAttr}\``;
|
||||
// 这里必须使用refEntity,否则在filter深层嵌套节点表达式时会出现entity不对应
|
||||
result = this.translateAttrInExpression(refEntity as T, (expr)['#refAttr'], attrText);
|
||||
}
|
||||
else {
|
||||
assert(k.length === 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue