* check for vision when querying tasks.

This commit is contained in:
Wenrui LI
2022-01-12 14:44:08 +08:00
parent fb0c6444c6
commit 7f0f0fa2eb
+3
View File
@@ -2150,6 +2150,7 @@ class taskModel extends model
->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id')
->leftJoin(TABLE_PROJECT)->alias('t4')->on("t1.project = t4.id")
->where('t1.deleted')->eq(0)
->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi()
->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi()
->beginIF($type == 'finishedBy')
@@ -2197,6 +2198,7 @@ class taskModel extends model
->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id')
->where('t1.assignedTo')->eq($account)
->andWhere('t1.deleted')->eq(0)
->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi()
->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi()
->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi()
->query();
@@ -2227,6 +2229,7 @@ class taskModel extends model
->orWhere('t3.status')->eq('suspended')
->markRight(1)
->andWhere('t1.deleted')->eq(0)
->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi()
->andWhere('t2.deleted')->eq(0)
->beginIF($this->config->systemMode == 'new')->andWhere('t3.deleted')->eq(0)->fi()
->fetchAll('id');