- 修复 ZeroDbEntity WhereDynamic 多表匹配问题;

This commit is contained in:
2881099
2025-08-26 21:13:18 +08:00
parent 368c07e613
commit bb5126b087

View File

@@ -733,7 +733,7 @@ namespace FreeSql.Extensions.ZeroEntity
}
foreach (var rm in replacedMap)
{
var find = $"{rm.Item3}.{_common.QuoteSqlName(rm.Item1)}";
var find = $"{_selectProvider._tables[0].Alias}.{_common.QuoteSqlName(rm.Item1)}";
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)}";
}