From ad213ae93ad8d4c00beec9b4c40ff6138583f101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Mon, 8 Nov 2021 18:56:48 +0800 Subject: [PATCH] * adjust for report api. --- api/v1/entries/reports.php | 5 ++--- module/report/model.php | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/api/v1/entries/reports.php b/api/v1/entries/reports.php index 55f434a3c5..656579ab53 100644 --- a/api/v1/entries/reports.php +++ b/api/v1/entries/reports.php @@ -83,7 +83,7 @@ class reportsEntry extends entry */ public function projectOverview($accounts) { - $statusOverview = $this->loadModel('report')->getProjectStatusOverview(array_keys($accounts)); + $statusOverview = $this->loadModel('report')->getProjectStatusOverview($accounts); $this->app->loadLang('project'); $total = 0; @@ -116,8 +116,7 @@ class reportsEntry extends entry */ public function radar($accounts, $year) { - $allAccounts = $this->loadModel('user')->getPairs('noletter|noclosed'); - $contributions = $this->loadModel('report')->getUserYearContributions(empty($accounts) ? array_keys($allAccounts) : $accounts, $year); + $contributions = $this->loadModel('report')->getUserYearContributions($accounts, $year); $annualDataConfig = $this->config->report->annualData; $radarData = array('product' => 0, 'execution' => 0, 'devel' => 0, 'qa' => 0, 'other' => 0); diff --git a/module/report/model.php b/module/report/model.php index ee5d1a2fe7..a6dc4f6e84 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -1124,6 +1124,13 @@ class reportModel extends model $outputData['case']['createBug'] += 1; } + $outputData['case']['run'] = $this->dao->select('count(*) as count')->from(TABLE_TESTRESULT)->alias('t1') + ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case=t2.id') + ->where('LEFT(t1.date, 4)')->eq($year) + ->andWhere('t2.deleted')->eq(0) + ->beginIF($accounts)->andWhere('t1.lastRunner')->in($accounts)->fi() + ->fetch('count'); + $processedOutput = array(); foreach($this->config->report->outputData as $objectType => $actions) {