From 647568cdddeaebdb0bd78cec53da9c8d6ac367a3 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 8 Feb 2017 20:16:17 -0500 Subject: Make query compatible with Postgres --- app/Model/ColumnModel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Model/ColumnModel.php b/app/Model/ColumnModel.php index 535a31e5..da5ea856 100644 --- a/app/Model/ColumnModel.php +++ b/app/Model/ColumnModel.php @@ -131,8 +131,8 @@ class ColumnModel extends Base { return $this->db->table(self::TABLE) ->columns('id', 'title', 'position', 'task_limit', 'description', 'hide_in_dashboard', 'project_id') - ->subquery('SELECT COUNT(*) FROM '.TaskModel::TABLE.' WHERE column_id='.self::TABLE.'.id AND is_active=1', 'nb_open_tasks') - ->subquery('SELECT COUNT(*) FROM '.TaskModel::TABLE.' WHERE column_id='.self::TABLE.'.id AND is_active=0', 'nb_closed_tasks') + ->subquery("SELECT COUNT(*) FROM ".TaskModel::TABLE." WHERE column_id=".self::TABLE.".id AND is_active='1'", 'nb_open_tasks') + ->subquery("SELECT COUNT(*) FROM ".TaskModel::TABLE." WHERE column_id=".self::TABLE.".id AND is_active='0'", 'nb_closed_tasks') ->eq('project_id', $project_id) ->asc('position') ->findAll(); -- cgit v1.2.3