From e8e6ecfd5afaf351365f82ed1fd36d598c111f5e Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Fri, 6 Aug 2021 11:46:15 +0800 Subject: [PATCH] * Fix issues api. --- api/v1/entries/projectissues.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/v1/entries/projectissues.php b/api/v1/entries/projectissues.php index f1d87f7790..63ed1f3ffd 100644 --- a/api/v1/entries/projectissues.php +++ b/api/v1/entries/projectissues.php @@ -33,7 +33,7 @@ class projectIssuesEntry extends entry $label = $this->param('label', ''); $search = $this->param('search', ''); $page = intval($this->param('page', 1)); - $limit = $this->param('limit', 20); + $limit = intval($this->param('limit', 20)); $order = $this->param('order', 'openedDate_desc'); $orderParams = explode('_', $order); @@ -66,7 +66,8 @@ class projectIssuesEntry extends entry $issues = array(); - $tasks = $this->dao->select($taskFields)->from(TABLE_TASK)->where('project')->in('(SELECT project FROM ' . TABLE_PROJECTPRODUCT . " WHERE product = $productID)") + $executions = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->eq($productID)->fetchPairs(); + $tasks = $this->dao->select($taskFields)->from(TABLE_TASK)->where('execution')->in(array_values($executions)) ->beginIF($search)->andWhere('name')->like("%$search%")->fi() ->beginIF($status)->andWhere('status')->in($taskStatus[$status])->fi() ->andWhere('deleted')->eq(0)