This commit is contained in:
wangyidong
2016-09-12 14:14:59 +08:00
parent e08432aaf2
commit 9a5c00cf72
+12 -3
View File
@@ -1151,9 +1151,18 @@ class task extends control
}
/* Get tasks. */
$tasks = $this->dao->select('*')->from(TABLE_TASK)->alias('t1')->where($this->session->taskQueryCondition)
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi()
->orderBy($orderBy)->fetchAll('id');
$tasks = array();
if($this->session->taskOnlyCondition)
{
$tasks = $this->dao->select('*')->from(TABLE_TASK)->alias('t1')->where($this->session->taskQueryCondition)
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi()
->orderBy($orderBy)->fetchAll('id');
}
else
{
$stmt = $this->dbh->query($this->session->taskQueryCondition . ($this->post->exportType == 'selected' ? " AND t1.id IN({$this->cookie->checkedItem})" : '') . " ORDER BY " . strtr($orderBy, '_', ' '));
while($row = $stmt->fetch()) $tasks[$row->id] = $row;
}
/* Get users and projects. */
$users = $this->loadModel('user')->getPairs('noletter');