This commit is contained in:
hufangzhou
2022-02-16 16:26:13 +08:00
parent d4b0db46cf
commit d355e858b4
+2 -2
View File
@@ -2188,14 +2188,14 @@ class taskModel extends model
public function getUserTasks($account, $type = 'assignedTo', $limit = 0, $pager = null, $orderBy = "id_desc", $projectID = 0)
{
if(!$this->loadModel('common')->checkField(TABLE_TASK, $type)) return array();
$noDeletedExecution = $this->loadModel('execution')->getPairs();
$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_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")
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t4.deleted')->eq(0)
->andWhere('t2.id')->in(array_keys($noDeletedExecution))
->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')