* Finish task #54318.

This commit is contained in:
liumengyi
2022-05-19 08:55:27 +08:00
parent 79006b3f89
commit dee4ff7043
3 changed files with 10 additions and 1 deletions
+6 -1
View File
@@ -2186,6 +2186,10 @@ class taskModel extends model
if(is_string($type)) $type = strtolower($type);
$fields = 'DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName';
$this->config->edition == 'max' && $fields .= ', t6.name as designName, t6.version as latestDesignVersion';
$actionID = array();
if($type == 'assignedbyme') $actionID = $this->dao->select('objectID')->from(TABLE_ACTION)->where('objectType')->eq('task')->andWhere('action')->eq('assigned')->andWhere('actor')->eq($this->app->user->account)->fetchPairs('objectID', 'objectID');
$tasks = $this->dao->select($fields)
->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
@@ -2207,8 +2211,9 @@ class taskModel extends model
->markRight(1)
->fi()
->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi()
->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi()
->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,assignedbyme,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi()
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
->beginIF($type == 'assignedbyme')->andWhere('t1.id')->in($actionID)->andWhere('t1.status')->ne('closed')->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)
->page($pager, 't1.id')