Skip to content

Commit

Permalink
Fix issue with postgresql (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph0tonic authored Feb 25, 2025
1 parent e53c360 commit c8a4484
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public function incidents(): object
return $this->incidents ??= Incident::query()
->toBase()
->selectRaw('count(*) as total')
->selectRaw('sum(case when ? in (incidents.status, coalesce(latest_update.status, ?)) then 1 else 0 end) as resolved', [IncidentStatusEnum::fixed->value, ''])
->selectRaw('sum(case when ? not in (incidents.status, coalesce(latest_update.status, ?)) then 1 else 0 end) as unresolved', [IncidentStatusEnum::fixed->value, ''])
->selectRaw('sum(case when ? in (incidents.status, coalesce(latest_update.status, ?)) then 1 else 0 end) as resolved', [IncidentStatusEnum::fixed->value, 0])
->selectRaw('sum(case when ? not in (incidents.status, coalesce(latest_update.status, ?)) then 1 else 0 end) as unresolved', [IncidentStatusEnum::fixed->value, 0])
->joinSub(function (Builder $query) {
$query
->select('iu1.updateable_id', 'iu1.status')
Expand Down

0 comments on commit c8a4484

Please sign in to comment.