diff --git a/app/Model/Traits/User/QueryTrait.php b/app/Model/Traits/User/QueryTrait.php index cb9c88059..2768e5a51 100644 --- a/app/Model/Traits/User/QueryTrait.php +++ b/app/Model/Traits/User/QueryTrait.php @@ -58,9 +58,12 @@ public function projectsWidthIssues($status = Project::STATUS_OPEN) return $this ->projects($status) ->with([ - 'issues' => function (Relations\Relation $query) { + 'issues' => function (Relations\Relation $query) use ($status) { $query->with('updatedBy'); $query->where('assigned_to', '=', $this->id); + if ($status === Project::STATUS_OPEN) { + $query->where('status', '=', Project\Issue::STATUS_OPEN); + } }, 'issues.user' => function () {}, 'issues.countComments' => function () {},