* Adjust the code.

This commit is contained in:
hufangzhou
2022-02-16 16:47:02 +08:00
parent d355e858b4
commit 2edcb893be
2 changed files with 1 additions and 3 deletions
-1
View File
@@ -174,7 +174,6 @@ class blockModel extends model
->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;
+1 -2
View File
@@ -2188,14 +2188,13 @@ 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.id')->in(array_keys($noDeletedExecution))
->andWhere('t2.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()
->beginIF($type == 'finishedBy')