add another field to group by, because it shall be selected

This commit is contained in:
Uwe Steinmann 2017-02-14 12:21:58 +01:00
parent 823e57c4c2
commit c34ea0ed02

View File

@ -2140,7 +2140,7 @@ class SeedDMS_Core_DMS {
function getStatisticalData($type='') { /* {{{ */ function getStatisticalData($type='') { /* {{{ */
switch($type) { switch($type) {
case 'docsperuser': case 'docsperuser':
$queryStr = "select b.`fullName` as `key`, count(`owner`) as total from `tblDocuments` a left join `tblUsers` b on a.`owner`=b.`id` group by `owner`"; $queryStr = "select b.`fullName` as `key`, count(`owner`) as total from `tblDocuments` a left join `tblUsers` b on a.`owner`=b.`id` group by `owner`, b.`fullName`";
$resArr = $this->db->getResultArray($queryStr); $resArr = $this->db->getResultArray($queryStr);
if (!$resArr) if (!$resArr)
return false; return false;
@ -2154,7 +2154,7 @@ class SeedDMS_Core_DMS {
return $resArr; return $resArr;
case 'docspercategory': case 'docspercategory':
$queryStr = "select b.`name` as `key`, count(a.`categoryID`) as total from `tblDocumentCategory` a left join `tblCategory` b on a.`categoryID`=b.id group by a.`categoryID`"; $queryStr = "select b.`name` as `key`, count(a.`categoryID`) as total from `tblDocumentCategory` a left join `tblCategory` b on a.`categoryID`=b.id group by a.`categoryID`, b.`name`";
$resArr = $this->db->getResultArray($queryStr); $resArr = $this->db->getResultArray($queryStr);
if (!$resArr) if (!$resArr)
return false; return false;