This commit is contained in:
hufangzhou
2021-12-24 13:16:23 +08:00
parent e28dfd6879
commit f02258f8e1
2 changed files with 14 additions and 15 deletions
+8 -9
View File
@@ -167,16 +167,15 @@ class blockModel extends model
$data = array();
$tasks = $this->dao->select('t1.id')->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = t2.id and t2.type = 'project'")
->leftJoin(TABLE_PROJECT)->alias('t3')->on("t1.execution = t3.id and (t3.type = 'sprint' or t3.type = 'stage')")
->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = t2.id")
->leftJoin(TABLE_EXECUTION)->alias('t3')->on("t1.execution = t3.id")
->where('t1.assignedTo')->eq($this->app->user->account)
->andWhere('t2.status')->ne('suspended')
->andWhere('t3.status')->ne('suspended')
->andWhere('t2.type')->eq('project')
->andWhere('t3.type')->in('sprint,stage')
->andWhere('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t3.deleted')->eq(0)
->andWhere('(t2.status')->ne('suspended')
->orWhere('t3.status')->ne('suspended')
->markRight(1)
->andWhere('t1.deleted')->eq('0')
->beginIF($this->config->systemMode == 'new')->andWhere('t2.deleted')->eq('0')->fi()
->andWhere('t3.deleted')->eq('0')
->fetchAll('id');
$data['tasks'] = isset($tasks) ? count($tasks) : 0;
$data['doneTasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('status')->eq('done')->fetch('count');
+6 -6
View File
@@ -2146,9 +2146,9 @@ class taskModel extends model
if(!$this->loadModel('common')->checkField(TABLE_TASK, $type)) return array();
$tasks = $this->dao->select('t1.*, t2.id as executionID, t2.name as executionName, t3.id as storyID, t3.title as storyTitle, t3.status AS storyStatus, t3.version AS latestStoryVersion')
->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.execution = t2.id and (t2.type = 'stage' or t2.type = 'sprint')")
->leftJoin(TABLE_EXECUTION)->alias('t2')->on("t1.execution = t2.id")
->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id')
->leftJoin(TABLE_PROJECT)->alias('t4')->on("t1.project = t4.id and t4.type = 'project'")
->leftJoin(TABLE_PROJECT)->alias('t4')->on("t1.project = t4.id")
->where('t1.deleted')->eq(0)
->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi()
@@ -2157,7 +2157,7 @@ class taskModel extends model
->orWhere('t1.finishedList')->like("%,{$account},%")
->markRight(1)
->fi()
->beginIF($this->app->rawModule == 'my' or $this->app->rawModule == 'block')->andWhere('t2.status')->ne('suspended')->andWhere('t4.status')->ne('suspended')->fi()
->beginIF($this->app->rawModule == 'my' or $this->app->rawModule == 'block')->andWhere('t2.status')->ne('suspended')->orWhere('t4.status')->ne('suspended')->fi()
->beginIF($type != 'all' and $type != 'finishedBy')->andWhere("t1.`$type`")->eq($account)->fi()
->orderBy($orderBy)
->beginIF($limit > 0)->limit($limit)->fi()
@@ -2220,15 +2220,15 @@ class taskModel extends model
{
$tasks = $this->dao->select('t1.*')
->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.execution = t2.id and (t2.type = 'sprint' or t2.type = 'stage')")
->leftJoin(TABLE_PROJECT)->alias('t3')->on("t1.project = t3.id and t3.type = 'project'")
->leftJoin(TABLE_EXECUTION)->alias('t2')->on("t1.execution = t2.id")
->leftJoin(TABLE_PROJECT)->alias('t3')->on("t1.project = t3.id")
->where('t1.assignedTo')->eq($this->app->user->account)
->andWhere('(t2.status')->eq('suspended')
->orWhere('t3.status')->eq('suspended')
->markRight(1)
->andWhere('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t3.deleted')->eq(0)
->beginIF($this->config->systemMode == 'new')->andWhere('t3.deleted')->eq(0)->fi()
->fetchAll('id');
return $tasks;
}