|
|
@@ -77,11 +77,11 @@ public class CustomViewEngine : ViewEngineModel
|
|
|
|
|
|
// 获取实体类型属性
|
|
|
var entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
|
|
|
-
|
|
|
+
|
|
|
// 因为ConfigId的表通常也会用到主库的表来做连接,所以这里如果在ConfigId中找不到实体也尝试一下在主库中查找
|
|
|
- if (ConfigId == SqlSugarConst.MainConfigId && entityType == null) return null;
|
|
|
- if (ConfigId != SqlSugarConst.MainConfigId)
|
|
|
+ if (entityType == null)
|
|
|
{
|
|
|
+ if (ConfigId == SqlSugarConst.MainConfigId) return null;
|
|
|
provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId);
|
|
|
entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
|
|
|
if (entityType == null) return null;
|