* Finish task #45157.

This commit is contained in:
liumengyi
2021-11-26 08:55:04 +08:00
parent 26da1c72cb
commit fb843381ca
6 changed files with 13 additions and 21 deletions

View File

@@ -2131,6 +2131,7 @@ class taskModel extends model
->from(TABLE_TASK)->alias('t1')
->leftjoin(TABLE_PROJECT)->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')
->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()
@@ -2139,6 +2140,7 @@ class taskModel extends model
->orWhere('t1.finishedList')->like("%,{$account},%")
->markRight(1)
->fi()
->beginIF($this->app->rawModule == 'my' || $this->app->rawModule == 'block')->andWhere('t2.status')->ne('suspended')->andWhere('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()
@@ -2158,24 +2160,6 @@ class taskModel extends model
$projectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($projectList)->fetchPairs('id');
foreach($tasks as $task) $task->projectName = zget($projectPairs, $task->project);
$suspendedLists = $this->dao->select('id')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->andWhere('status')->eq('suspended')
->andWhere('type')->in('project,sprint')
->fetchAll('id');
foreach($tasks as $task)
{
foreach($suspendedLists as $suspendedList)
{
if($task->project == $suspendedList->id || $task->execution == $suspendedList->id)
{
$task->isSuspened = 1;
break;
}
}
if(!isset($task->isSuspened)) $task->isSuspened = 0;
}
if($tasks) return $this->processTasks($tasks);
return array();
}
@@ -2194,10 +2178,12 @@ class taskModel extends model
$stmt = $this->dao->select('t1.id, t1.name, t2.name as execution')
->from(TABLE_TASK)->alias('t1')
->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id')
->leftjoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
->where('t1.assignedTo')->eq($account)
->andWhere('t1.deleted')->eq(0)
->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi()
->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi()
->andWhere('t2.status')->ne('suspended')->andWhere('t3.status')->ne('suspended')->fi()
->query();
$tasks = array();