mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-30 12:47:57 +08:00
Filter Bug
This commit is contained in:
parent
6a3d26e51b
commit
262a4be1d1
@ -8,8 +8,8 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
public class Config
|
public class Config
|
||||||
{
|
{
|
||||||
public static string ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=root";
|
public static string ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql";
|
||||||
public static string ConnectionString2 = "server=localhost;Database=SQLSUGAR4XTEST;Uid=root;Pwd=root";
|
public static string ConnectionString2 = "server=localhost;Database=SQLSUGAR4XTEST;Uid=root;Pwd=haosql";
|
||||||
public static string ConnectionString3 = "server=localhost;Database=sqlsugar4xtest;Uid=root;Pwd=root";
|
public static string ConnectionString3 = "server=localhost;Database=sqlsugar4xtest;Uid=root;Pwd=haosql";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace OrmTest.Demo
|
|||||||
//gobal filter
|
//gobal filter
|
||||||
var db = GetInstance1();
|
var db = GetInstance1();
|
||||||
|
|
||||||
var sql = db.Queryable<Student>().ToSql();
|
var sql = db.Queryable<Student>().OrderBy(it=>it.Id).ToSql();
|
||||||
//SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE isDelete=0
|
//SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE isDelete=0
|
||||||
|
|
||||||
var sql2 = db.Queryable<Student, School>((f, s) => new object[] { JoinType.Left, f.SchoolId == s.Id }).ToSql();
|
var sql2 = db.Queryable<Student, School>((f, s) => new object[] { JoinType.Left, f.SchoolId == s.Id }).ToSql();
|
||||||
|
@ -1207,7 +1207,7 @@ namespace SqlSugar
|
|||||||
foreach (var item in list)
|
foreach (var item in list)
|
||||||
{
|
{
|
||||||
var filterResult = item.FilterValue(this.Context);
|
var filterResult = item.FilterValue(this.Context);
|
||||||
Where(filterResult.Sql, filterResult.Parameters);
|
Where(filterResult.Sql+UtilConstants.Space, filterResult.Parameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ namespace SqlSugar
|
|||||||
foreach (var item in gobalFilterList.Where(it => it.IsJoinQuery == !IsSingle()))
|
foreach (var item in gobalFilterList.Where(it => it.IsJoinQuery == !IsSingle()))
|
||||||
{
|
{
|
||||||
var filterResult = item.FilterValue(this.Context);
|
var filterResult = item.FilterValue(this.Context);
|
||||||
WhereInfos.Add(this.Builder.AppendWhereOrAnd(this.WhereInfos.IsNullOrEmpty(), filterResult.Sql));
|
WhereInfos.Add(this.Builder.AppendWhereOrAnd(this.WhereInfos.IsNullOrEmpty(), filterResult.Sql+UtilConstants.Space));
|
||||||
var filterParamters = this.Context.Ado.GetParameters(filterResult.Parameters);
|
var filterParamters = this.Context.Ado.GetParameters(filterResult.Parameters);
|
||||||
if (filterParamters.HasValue())
|
if (filterParamters.HasValue())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user