mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-16 21:30:57 +08:00
-修复 ZeroDbContext WhereDyanmicFilter DataRange bug;
This commit is contained in:
@@ -734,8 +734,14 @@ namespace FreeSql.Extensions.ZeroEntity
|
|||||||
foreach (var rm in replacedMap)
|
foreach (var rm in replacedMap)
|
||||||
{
|
{
|
||||||
var find = $"{_selectProvider._tables[0].Alias}.{_common.QuoteSqlName(rm.Item1)}";
|
var find = $"{_selectProvider._tables[0].Alias}.{_common.QuoteSqlName(rm.Item1)}";
|
||||||
var idx = newWhere.IndexOf(find);
|
while (true)
|
||||||
if (idx != -1 && !Regex.IsMatch(newWhere.Substring(idx - 1, 1), @"[\w_]")) newWhere = $"{newWhere.Substring(0, idx)}{rm.Item2}{newWhere.Substring(idx + find.Length)}";
|
{
|
||||||
|
var idx = newWhere.IndexOf(find);
|
||||||
|
if (idx != -1 && !Regex.IsMatch(newWhere.Substring(idx - 1, 1), @"[\w_]"))
|
||||||
|
newWhere = $"{newWhere.Substring(0, idx)}{rm.Item2}{newWhere.Substring(idx + find.Length)}";
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return newWhere;
|
return newWhere;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user