summaryrefslogtreecommitdiff
path: root/app/Filter/TaskLinkFilter.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Filter/TaskLinkFilter.php')
-rw-r--r--app/Filter/TaskLinkFilter.php11
1 files changed, 2 insertions, 9 deletions
diff --git a/app/Filter/TaskLinkFilter.php b/app/Filter/TaskLinkFilter.php
index 98cd597f..0fa80d5c 100644
--- a/app/Filter/TaskLinkFilter.php
+++ b/app/Filter/TaskLinkFilter.php
@@ -57,13 +57,7 @@ class TaskLinkFilter extends BaseFilter implements FilterInterface
*/
public function apply()
{
- $task_ids = $this->getSubQuery()->findAllByColumn('task_id');
-
- if (! empty($task_ids)) {
- $this->query->in(TaskModel::TABLE.'.id', $task_ids);
- } else {
- $this->query->eq(TaskModel::TABLE.'.id', 0); // No match
- }
+ $this->query->inSubquery(TaskModel::TABLE.'.id', $this->getSubQuery());
}
/**
@@ -76,8 +70,7 @@ class TaskLinkFilter extends BaseFilter implements FilterInterface
{
return $this->db->table(TaskLinkModel::TABLE)
->columns(
- TaskLinkModel::TABLE.'.task_id',
- LinkModel::TABLE.'.label'
+ TaskLinkModel::TABLE.'.task_id'
)
->join(LinkModel::TABLE, 'id', 'link_id', TaskLinkModel::TABLE)
->ilike(LinkModel::TABLE.'.label', $this->value);