* Finish task#8742.

This commit is contained in:
hufangzhou
2020-12-23 14:56:56 +08:00
parent 60e6cdd115
commit 45ecde5875
2 changed files with 22 additions and 15 deletions
+8 -7
View File
@@ -1380,13 +1380,14 @@ class bugModel extends model
public function getUserBugs($account, $type = 'assignedTo', $orderBy = 'id_desc', $limit = 0, $pager = null, $projectID = 0)
{
if(!$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array();
$bugs = $this->dao->select('*')->from(TABLE_BUG)
->where('deleted')->eq(0)
->beginIF($projectID)->andWhere('PRJ')->eq($projectID)->fi()
->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('status')->ne('closed')->fi()
->beginIF($type != 'all')->andWhere("`$type`")->eq($account)->fi()
->beginIF($this->app->rawMethod == 'contribute')->andWhere("status")->in('resolved,closed')->fi()
->beginIF($this->app->rawMethod == 'work')->andWhere("status")->eq('active')->fi()
$bugs = $this->dao->select('t1.*,t2.name as productName')->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.deleted')->eq(0)
->beginIF($projectID)->andWhere('t1.PRJ')->eq($projectID)->fi()
->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($type != 'all')->andWhere("t1.`$type`")->eq($account)->fi()
->beginIF($this->app->rawMethod == 'contribute')->andWhere("t1.status")->in('resolved,closed')->fi()
->beginIF($this->app->rawMethod == 'work')->andWhere("t1.status")->eq('active')->fi()
->orderBy($orderBy)
->beginIF($limit > 0)->limit($limit)->fi()
->page($pager)