You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Status.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -80,8 +80,8 @@ public function incidents(): object
80
80
return$this->incidents ??= Incident::query()
81
81
->toBase()
82
82
->selectRaw('count(*) as total')
83
-
->selectRaw('sum(case when ? in (incidents.status, latest_update.status) then 1 else 0 end) as resolved', [IncidentStatusEnum::fixed->value])
84
-
->selectRaw('sum(case when ? not in (incidents.status, latest_update.status) then 1 else 0 end) as unresolved', [IncidentStatusEnum::fixed->value])
83
+
->selectRaw('sum(case when ? in (incidents.status, coalesce(latest_update.status, ?)) then 1 else 0 end) as resolved', [IncidentStatusEnum::fixed->value, ''])
84
+
->selectRaw('sum(case when ? not in (incidents.status, coalesce(latest_update.status, ?)) then 1 else 0 end) as unresolved', [IncidentStatusEnum::fixed->value, ''])
85
85
->joinSub(function (Builder$query) {
86
86
$query
87
87
->select('iu1.updateable_id', 'iu1.status')
@@ -92,8 +92,8 @@ public function incidents(): object
0 commit comments