From c38756c7fc63e3889deeeb5384680fe1ee539cfd Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Mon, 30 Nov 2020 08:19:50 +0800 Subject: [PATCH] * Fix a bug. --- module/bug/model.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index dd3057037c..5385691ba5 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1367,17 +1367,19 @@ class bugModel extends model * @param string $type * @param string $orderBy * @param int $limit - * @param int $pager + * @param object $pager + * @param int $projectID * @access public * @return void */ - public function getUserBugs($account, $type = 'assignedTo', $orderBy = 'id_desc', $limit = 0, $pager = null, $programID = 0) + public function getUserBugs($account, $type = 'assignedTo', $orderBy = 'id_desc', $limit = 0, $pager = null, $projectID = 0) { if(!$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array(); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('deleted')->eq(0) - ->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi() - ->beginIF(!$this->app->user->admin)->andWhere('project')->in('0,' . $this->app->user->view->projects)->fi() + ->beginIF($projectID)->andWhere('PRJ')->eq($projectID)->fi() + ->beginIF(!$this->app->user->admin)->andWhere('PRJ')->in($this->app->user->view->projects)->fi() + ->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->sprints)->fi() ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('status')->ne('closed')->fi() ->beginIF($type != 'all')->andWhere("`$type`")->eq($account)->fi() ->orderBy($orderBy)