* Fix bug.

This commit is contained in:
leiyong
2020-10-30 17:32:19 +08:00
parent 5644b81408
commit 680c880b5a
10 changed files with 36 additions and 30 deletions
+7 -2
View File
@@ -980,9 +980,14 @@ class programModel extends model
*/
public function getPRJRecent()
{
return $this->dao->select('id,parent,name')->from(TABLE_PROJECT)
if(!$this->app->user->admin && (empty($this->app->user->view->sprints) || empty($this->app->user->view->projects)))
{
return array();
}
return $this->dao->select('id,project,name')->from(TABLE_PROJECT)
->where('type')->in('stage,sprint')
->beginIF(!$this->app->user->admin && $this->app->user->view->projects)->andWhere('parent')->in($this->app->user->view->projects)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->projects)->fi()
->andWhere('status')->ne('status')
->andWhere('deleted')->eq('0')
->orderBy('id_desc')