From 5afccb24a58b5d1a20f3e8247ac4c84e36c8445f Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 24 Oct 2018 09:36:57 +0800 Subject: [PATCH] * Finish task #5037. --- module/bug/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index c77772e9b7..fb7023fe82 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1657,9 +1657,8 @@ class bugModel extends model */ public function getDataOfBugsPerBuild() { - $datas = $this->dao->select('openedBuild as name, count(openedBuild) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('openedBuild')->orderBy('openedBuild DESC')->fetchAll('name'); + $datas = $this->dao->select('openedBuild as name, count(openedBuild) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('openedBuild')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); - ksort($datas); $builds = $this->loadModel('build')->getProductBuildPairs($this->session->product, $branch = 0, $params = ''); /* Deal with the situation that a bug maybe associate more than one openedBuild. */ foreach($datas as $buildIDList => $data) @@ -1688,6 +1687,7 @@ class bugModel extends model { $data->name = isset($builds[$buildID]) ? $builds[$buildID] : $this->lang->report->undefined; } + ksort($datas); return $datas; }