* Finish task #45157.

This commit is contained in:
liumengyi
2021-11-29 08:21:29 +08:00
parent e5f3e87ea1
commit f77c484548
2 changed files with 29 additions and 2 deletions
+17 -1
View File
@@ -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;
+12 -1
View File
@@ -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'));