From 79ebc83763285c1f40bda82b9246c70db64eef8f Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 11 Mar 2025 20:12:28 +0800 Subject: [PATCH] Update Subquery.WithAttr --- .../SqlSugar/ExpressionsToSql/Subquery/SubResolve.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/SubResolve.cs b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/SubResolve.cs index 58e2cdccb..db6b36082 100644 --- a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/SubResolve.cs +++ b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/SubResolve.cs @@ -186,6 +186,10 @@ namespace SqlSugar { var asName = this.context.GetTranslationTableName(asItems.First().Replace(subKey, ""), false); var repKey = $"\\{this.context.SqlTranslationLeft}.+\\{this.context.SqlTranslationRight}"; + if (this.context.CurrentShortName.HasValue()) + { + asName = asName + " " + this.context.CurrentShortName; + } sqlItems[i] = Regex.Replace(sqlItems[i], repKey, asName); } }