diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs index c1c31612f..5452fed77 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs @@ -432,10 +432,12 @@ namespace SqlSugar public virtual ISugarQueryable Queryable(ISugarQueryable queryable) { var sqlobj = queryable.ToSql(); + var QueryBuilder = queryable.QueryBuilder; var newQueryable = this.SqlQueryable(sqlobj.Key).AddParameters(sqlobj.Value); var result = newQueryable.Select(newQueryable.QueryBuilder.SelectValue+""); result.QueryBuilder.IsSqlQuery = false; result.QueryBuilder.NoCheckInclude = true; + result.QueryBuilder.WhereIndex = (QueryBuilder.WhereIndex + 1); result.QueryBuilder.Includes = queryable.QueryBuilder.Includes?.ToList(); return result; }