Fix AlarmedZoneId filter term not working because I wrote AlarmZoneId instead

This commit is contained in:
Isaac Connor 2021-05-02 13:38:06 -04:00
parent 91a09608ea
commit 44e8107cac
1 changed files with 10 additions and 6 deletions

View File

@ -148,15 +148,14 @@ class FilterTerm {
} # end function sql_values } # end function sql_values
public function sql_operator() { public function sql_operator() {
switch ( $this->attr ) { switch ($this->attr) {
case 'AlarmZoneId': case 'AlarmedZoneId':
return ' EXISTS '; return ' EXISTS ';
case 'ExistsInFileSystem': case 'ExistsInFileSystem':
case 'DiskPercent': case 'DiskPercent':
return ''; return '';
} }
switch ( $this->op ) { switch ( $this->op ) {
case '=' : case '=' :
case '!=' : case '!=' :
@ -201,13 +200,17 @@ class FilterTerm {
$sql = ''; $sql = '';
if ( isset($this->cnj) ) { if ( isset($this->cnj) ) {
$sql .= ' '.$this->cnj.' '; $sql .= ' '.$this->cnj;
} }
if ( isset($this->obr) ) { if ( isset($this->obr) ) {
$sql .= ' '.str_repeat('(', $this->obr).' '; $sql .= ' '.str_repeat('(', $this->obr);
} }
$sql .= ' ';
switch ( $this->attr ) { switch ( $this->attr ) {
case 'AlarmedZoneId':
$sql .= '/* AlarmedZoneId */ ';
break;
case 'ExistsInFileSystem': case 'ExistsInFileSystem':
case 'DiskPercent': case 'DiskPercent':
$sql .= 'TRUE /*'.$this->attr.'*/'; $sql .= 'TRUE /*'.$this->attr.'*/';
@ -307,8 +310,9 @@ class FilterTerm {
} }
if ( isset($this->cbr) ) { if ( isset($this->cbr) ) {
$sql .= ' '.str_repeat(')', $this->cbr).' '; $sql .= ' '.str_repeat(')', $this->cbr);
} }
$sql .= PHP_EOL;
return $sql; return $sql;
} # end public function sql } # end public function sql