mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-31 14:07:16 +00:00
Merge branch 'seeddms-5.0.x' into seeddms-5.1.x
This commit is contained in:
commit
05cf0b83f4
|
@ -2864,29 +2864,29 @@ class SeedDMS_Core_DMS {
|
|||
function getStatisticalData($type='') { /* {{{ */
|
||||
switch($type) {
|
||||
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);
|
||||
if (!$resArr)
|
||||
return false;
|
||||
|
||||
return $resArr;
|
||||
case 'docspermimetype':
|
||||
$queryStr = "select b.`mimeType` as `key`, count(mimeType) as total from `tblDocuments` a left join `tblDocumentContent` b on a.`id`=b.`document` group by b.`mimeType`";
|
||||
$queryStr = "select b.`mimeType` as `key`, count(`mimeType`) as total from `tblDocuments` a left join `tblDocumentContent` b on a.`id`=b.`document` group by b.`mimeType`";
|
||||
$resArr = $this->db->getResultArray($queryStr);
|
||||
if (!$resArr)
|
||||
return false;
|
||||
|
||||
return $resArr;
|
||||
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);
|
||||
if (!$resArr)
|
||||
return false;
|
||||
|
||||
return $resArr;
|
||||
case 'docsperstatus':
|
||||
$queryStr = "select b.`status` as `key`, count(b.`status`) as total from (select a.id, max(b.version), max(c.`statusLogId`) as maxlog from `tblDocuments` a left join `tblDocumentStatus` b on a.id=b.`documentid` left join `tblDocumentStatusLog` c on b.`statusid`=c.`statusid` group by a.`id`, b.`version` order by a.`id`, b.`statusid`) a left join `tblDocumentStatusLog` b on a.`maxlog`=b.`statusLogId` group by b.`status`";
|
||||
$queryStr = "select b.status as `key`, count(b.status) as total from (select a.id, max(c.`statusLogId`) as maxlog from `tblDocuments` a left join `tblDocumentStatus` b on a.id=b.`documentid` left join `tblDocumentStatusLog` c on b.`statusid`=c.`statusid` group by a.`id` order by a.id, b.`statusid`) a left join `tblDocumentStatusLog` b on a.maxlog=b.`statusLogId` group by b.`status`";
|
||||
$queryStr = "select b.`status` as `key`, count(b.`status`) as total from (select a.id, max(b.version), max(c.`statusLogID`) as maxlog from `tblDocuments` a left join `tblDocumentStatus` b on a.id=b.`documentID` left join `tblDocumentStatusLog` c on b.`statusID`=c.`statusID` group by a.`id`, b.`version` order by a.`id`, b.`statusID`) a left join `tblDocumentStatusLog` b on a.`maxlog`=b.`statusLogID` group by b.`status`";
|
||||
$queryStr = "select b.`status` as `key`, count(b.`status`) as total from (select a.`id`, max(c.`statusLogID`) as maxlog from `tblDocuments` a left join `tblDocumentStatus` b on a.id=b.`documentID` left join `tblDocumentStatusLog` c on b.`statusID`=c.`statusID` group by a.`id` order by a.id) a left join `tblDocumentStatusLog` b on a.maxlog=b.`statusLogID` group by b.`status`";
|
||||
$resArr = $this->db->getResultArray($queryStr);
|
||||
if (!$resArr)
|
||||
return false;
|
||||
|
@ -2916,7 +2916,7 @@ class SeedDMS_Core_DMS {
|
|||
}
|
||||
return $resArr;
|
||||
case 'sizeperuser':
|
||||
$queryStr = "select c.`fullName` as `key`, sum(`fileSize`) as total from `tblDocuments` a left join `tblDocumentContent` b on a.id=b.`document` left join `tblUsers` c on a.`owner`=c.`id` group by a.`owner`";
|
||||
$queryStr = "select c.`fullName` as `key`, sum(`fileSize`) as total from `tblDocuments` a left join `tblDocumentContent` b on a.id=b.`document` left join `tblUsers` c on a.`owner`=c.`id` group by a.`owner`, c.`fullName`";
|
||||
$resArr = $this->db->getResultArray($queryStr);
|
||||
if (!$resArr)
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user