Sort each zone on the custom dashboard by the combined active FSO count.
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m44s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m44s
Details
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
f67aab1fdc
commit
bc4d3d056b
|
|
@ -199,9 +199,9 @@ class ZenovaReportController extends Controller
|
|||
if ($zone !== 0) {
|
||||
return $zone;
|
||||
}
|
||||
$users = $this->fsoCount($right) <=> $this->fsoCount($left);
|
||||
if ($users !== 0) {
|
||||
return $users;
|
||||
$active = $this->activeFsoTotal($right) <=> $this->activeFsoTotal($left);
|
||||
if ($active !== 0) {
|
||||
return $active;
|
||||
}
|
||||
|
||||
return strcasecmp($this->rowName($left), $this->rowName($right));
|
||||
|
|
@ -229,11 +229,19 @@ class ZenovaReportController extends Controller
|
|||
return '';
|
||||
}
|
||||
|
||||
private function fsoCount($row): float
|
||||
private function activeFsoTotal($row): float
|
||||
{
|
||||
$value = $row->{'Demography & Details'}->{'No. of FSOs'} ?? 0;
|
||||
$demo = $row->{'Demography & Details'} ?? null;
|
||||
if (!is_object($demo)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return is_numeric($value) ? (float) $value : 0;
|
||||
$glipiq = $demo->{'Glipiq Active FSOs'} ?? 0;
|
||||
$sitazit = $demo->{'Sitazit Active FSOs'} ?? 0;
|
||||
$glipiq = is_numeric($glipiq) ? (float) $glipiq : 0;
|
||||
$sitazit = is_numeric($sitazit) ? (float) $sitazit : 0;
|
||||
|
||||
return $glipiq + $sitazit;
|
||||
}
|
||||
|
||||
private function rowName($row): string
|
||||
|
|
|
|||
Loading…
Reference in New Issue