From 4b1970326fb768bdf4c8c932e324f5dae0b94dd5 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Sat, 12 Oct 2024 16:47:58 +0800 Subject: [PATCH] * [task#130242,done,1h] add involoved data for task list. --- module/my/tao.php | 6 ++++-- module/task/model.php | 2 +- module/task/tao.php | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/module/my/tao.php b/module/my/tao.php index f6404c3c8e..9d6d630ee1 100644 --- a/module/my/tao.php +++ b/module/my/tao.php @@ -102,14 +102,16 @@ class myTao extends myModel ->andWhere('t1.openedBy', 1)->eq($account) ->orWhere('t1.closedBy')->eq($account) ->orWhere('t1.canceledBy')->eq($account) - ->orWhere('t1.finishedby', 1)->eq($account) - ->orWhere('t5.status')->eq("done") + ->orWhere('t1.finishedby')->eq($account) + ->orWhere('t1.assignedTo')->eq($account) + ->orWhere('t5.account')->eq($account) ->orWhere('t1.id')->in($taskIdList) ->markRight(1) ->fi() ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($this->config->vision)->andWhere('t2.vision')->eq($this->config->vision)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.execution')->in($this->app->user->view->sprints)->fi() + ->groupBy('t1.id') ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager, 't1.id') diff --git a/module/task/model.php b/module/task/model.php index 7908a6238e..1b19538402 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2106,7 +2106,7 @@ class taskModel extends model */ public function getUserTasks(string $account, string $type = 'assignedTo', int $limit = 0, object $pager = null, string $orderBy = 'id_desc', int $projectID = 0): array { - if(!$this->loadModel('common')->checkField(TABLE_TASK, $type)) return array(); + if($type != 'myInvolved' && !$this->loadModel('common')->checkField(TABLE_TASK, $type)) return array(); $tasks = $this->taskTao->fetchUserTasksByType($account, $type, $orderBy, $projectID, $limit, $pager); diff --git a/module/task/tao.php b/module/task/tao.php index 29acf039ac..5293226797 100644 --- a/module/task/tao.php +++ b/module/task/tao.php @@ -580,9 +580,12 @@ class taskTao extends taskModel ->markRight(1) ->fi() ->beginIF($type == 'assignedTo' && ($this->app->rawModule == 'my' || $this->app->rawModule == 'block'))->andWhere('t2.status', true)->ne('suspended')->orWhere('t4.status')->ne('suspended')->markRight(1)->fi() - ->beginIF($type != 'all' && $type != 'finishedBy' && $type != 'assignedTo')->andWhere("t1.`$type`")->eq($account)->fi() + ->beginIF(!in_array($type, array('all', 'finishedBy', 'assignedTo', 'myInvolved')))->andWhere("t1.`$type`")->eq($account)->fi() ->beginIF($type == 'assignedTo')->andWhere("(t1.assignedTo = '{$account}' or (t1.mode = 'multi' and t5.`account` = '{$account}' and t1.status != 'closed' and t5.status != 'done') )")->fi() ->beginIF($type == 'assignedTo' && $this->app->rawModule == 'my' && $this->app->rawMethod == 'work')->andWhere('t1.status')->notin('closed,cancel')->fi() + ->beginIF($type == 'myInvolved') + ->andWhere("((t5.`account` = '{$this->app->user->account}') OR t1.`assignedTo` = '{$this->app->user->account}' OR t1.`finishedby` = '{$this->app->user->account}')") + ->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager, 't1.id')