From c59e9afaa8629b2f7c54d05cda1c0f71fd0647c2 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 29 Sep 2022 02:59:53 +0000 Subject: [PATCH 1/2] * Get scrum risk and issue. --- module/custom/model.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/module/custom/model.php b/module/custom/model.php index cc24f6e11c..031371a851 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -951,7 +951,14 @@ class customModel extends model */ public function hasScrumIssueData() { - if($this->config->edition == 'max') return $this->dao->select('*')->from(TABLE_ISSUE)->where('deleted')->eq('0')->andWhere('execution')->ne(0)->count(); + if($this->config->edition == 'max') + { + return $this->dao->select('t1.*')->from(TABLE_ISSUE)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t1.deleted')->eq('0') + ->andWhere('t2.model')->eq('scrum') + ->count(); + } return false; } @@ -963,7 +970,14 @@ class customModel extends model */ public function hasScrumRiskData() { - if($this->config->edition == 'max') return $this->dao->select('*')->from(TABLE_RISK)->where('deleted')->eq('0')->andWhere('execution')->ne(0)->count(); + if($this->config->edition == 'max') + { + return $this->dao->select('t1.*')->from(TABLE_RISK)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t1.deleted')->eq('0') + ->andWhere('t2.model')->eq('scrum') + ->count(); + } return false; } From e1d1aaac06d390c9e827ba643605a6ece8d66f8b Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 29 Sep 2022 05:18:26 +0000 Subject: [PATCH 2/2] * Get undeleted data. --- module/custom/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/custom/model.php b/module/custom/model.php index 031371a851..5f70e59416 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -956,6 +956,7 @@ class customModel extends model return $this->dao->select('t1.*')->from(TABLE_ISSUE)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.deleted')->eq('0') + ->andWhere('t2.deleted')->eq('0') ->andWhere('t2.model')->eq('scrum') ->count(); } @@ -975,6 +976,7 @@ class customModel extends model return $this->dao->select('t1.*')->from(TABLE_RISK)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.deleted')->eq('0') + ->andWhere('t2.deleted')->eq('0') ->andWhere('t2.model')->eq('scrum') ->count(); }