|
|
@@ -117,8 +117,11 @@ func HasRule(dbSchema string, scope string, domainName string, i *infrastructure
|
|
|
dbExecutor := i.DBExecutor()
|
|
|
|
|
|
return database.CheckExist(dbExecutor, &sql.CheckExistExecuteParams{
|
|
|
- TableName: domain.TableName(dbSchema, &Entity{}),
|
|
|
- Conditions: sql.NewConditions().Equal(ColumnScope, scope).Equal(ColumnDomainName, domainName),
|
|
|
+ TableName: domain.TableName(dbSchema, &Entity{}),
|
|
|
+ Conditions: sql.NewConditions().
|
|
|
+ Equal(ColumnScope, scope).
|
|
|
+ Equal(ColumnDomainName, domainName).
|
|
|
+ Equal(ColumnEnabled, true),
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -150,8 +153,11 @@ func getRule(dbSchema string, scope string, domainName string, i *infrastructure
|
|
|
dbExecutor := i.DBExecutor()
|
|
|
|
|
|
result, err := database.QueryOne(dbExecutor, &sql.QueryOneExecuteParams{
|
|
|
- TableName: domain.TableName(dbSchema, &Entity{}),
|
|
|
- Conditions: sql.NewConditions().Equal(ColumnScope, scope).Equal(ColumnDomainName, domainName),
|
|
|
+ TableName: domain.TableName(dbSchema, &Entity{}),
|
|
|
+ Conditions: sql.NewConditions().
|
|
|
+ Equal(ColumnScope, scope).
|
|
|
+ Equal(ColumnDomainName, domainName).
|
|
|
+ Equal(ColumnEnabled, true),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return Rule{}, err
|