From f77c484548e67ebeb97859a893bf2e230c599114 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 08:21:29 +0800 Subject: [PATCH] * Finish task #45157. --- module/my/control.php | 18 +++++++++++++++++- module/task/control.php | 13 ++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 36e5c00177..4ac22b9ba1 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -147,8 +147,24 @@ class my extends control /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); + $todos = $this->loadModel('todo')->getList($type, $account, $status, 0, $pager, $sort); + $tasks = $this->loadModel('task')->getUserSuspendedTasks($account); + foreach($todos as $key => $todo) + { + foreach($tasks as $task) + { + if($todo->type == 'task' and $todo->idvalue = $task->id) + { + unset($todos[$key]); + break; + } + } + } + + $pager->recTotal = count($todos); + /* Assign. */ - $this->view->todos = $this->loadModel('todo')->getList($type, $account, $status, 0, $pager, $sort); + $this->view->todos = $todos; $this->view->date = (int)$type == 0 ? date(DT_DATE1) : date(DT_DATE1, strtotime($type)); $this->view->type = $type; $this->view->recTotal = $recTotal; diff --git a/module/task/control.php b/module/task/control.php index a6890a14d0..f21f70d066 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1348,7 +1348,18 @@ class task extends control $user = $this->loadModel('user')->getById($userID, 'id'); $account = $user->account; - $tasks = $this->task->getUserTaskPairs($account, $status); + $tasks = $this->task->getUserTaskPairs($account, $status); + $suspendedTasks = $this->task->getUserSuspendedTasks($account); + foreach($tasks as $taskid => $task) + { + foreach($suspendedTasks as $suspendedTask) + { + if($taskid == $suspendedTask->id) + { + unset($tasks[$taskid]); + } + } + } if($id) die(html::select("tasks[$id]", $tasks, '', 'class="form-control"')); die(html::select('task', $tasks, '', 'class=form-control'));