Corrected active_count for Alert icon color (#9933)

* Corrected active_count for Alert icon color

* Corrected active_count for Alert icon color

* Corrected active_count for Alert icon color

* Laravel version

* Laravel version check status worse and better for isActive

* cleanup
This commit is contained in:
PipoCanaja
2019-03-14 03:01:30 +01:00
committed by Tony Murray
parent 19612cf38d
commit 787a8fc309
3 changed files with 7 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ class AlertRule extends BaseModel
*/
public function scopeEnabled($query)
{
return $query->where('disabled', 0);
return $query->where('alert_rules.disabled', 0);
}
/**
@@ -52,7 +52,7 @@ class AlertRule extends BaseModel
{
return $query->enabled()
->join('alerts', 'alerts.rule_id', 'alert_rules.id')
->where('alerts.state', 1);
->whereNotIn('alerts.state', [0, 2]);
}
/**