fix sql statements in getStatisticalData()

makes them work for sqlite and mysql
This commit is contained in:
Uwe Steinmann 2014-04-09 09:24:01 +02:00
parent e807628eda
commit 1687ba233f

View File

@ -2073,14 +2073,14 @@ class SeedDMS_Core_DMS {
return $resArr; return $resArr;
case 'docspermonth': case 'docspermonth':
$queryStr = "select `key`, count(`key`) as total from (select ".$this->db->getDateExtract("date")." as `key` from tblDocuments) a group by `key` order by `key`"; $queryStr = "select *, count(`key`) as total from (select ".$this->db->getDateExtract("date", '%Y-%m')." as `key` from tblDocuments) a group by `key` order by `key`";
$resArr = $this->db->getResultArray($queryStr); $resArr = $this->db->getResultArray($queryStr);
if (!$resArr) if (!$resArr)
return false; return false;
return $resArr; return $resArr;
case 'docsaccumulated': case 'docsaccumulated':
$queryStr = "select `key`, count(`key`) as total from (select ".$this->db->getDateExtract("date")." as `key` from tblDocuments) a group by `key` order by `key`"; $queryStr = "select *, count(`key`) as total from (select ".$this->db->getDateExtract("date")." as `key` from tblDocuments) a group by `key` order by `key`";
$resArr = $this->db->getResultArray($queryStr); $resArr = $this->db->getResultArray($queryStr);
if (!$resArr) if (!$resArr)
return false; return false;