|
|
@ -9,6 +9,7 @@ class Admin_StatController extends Zend_Controller_Action
|
|
|
|
$this->view->messages = $this->messenger->getMessages();
|
|
|
|
$this->view->messages = $this->messenger->getMessages();
|
|
|
|
$this->view->theme = new Theme();
|
|
|
|
$this->view->theme = new Theme();
|
|
|
|
$this->_helper->layout->setLayout('administry');
|
|
|
|
$this->_helper->layout->setLayout('administry');
|
|
|
|
|
|
|
|
$this->submd=$this->view->config->sub->metadata;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function postDispatch()
|
|
|
|
function postDispatch()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -17,27 +18,27 @@ class Admin_StatController extends Zend_Controller_Action
|
|
|
|
function indexAction()
|
|
|
|
function indexAction()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$sql="select (select count(id) from users) as alluser,
|
|
|
|
$sql="select (select count(id) from users) as alluser,
|
|
|
|
(select count(id) from normalmetadata) as alldata,
|
|
|
|
(select count(id) from $this->submd) as alldata,
|
|
|
|
(select count(id) as num from dataorder where status=0) as onlinedown,
|
|
|
|
(select count(id) as num from dataorder where status=0 and uuid in (select uuid from $this->submd)) as onlinedown,
|
|
|
|
(select count(id) as num from dataorder where status=5) as offlinedown,
|
|
|
|
(select count(id) as num from dataorder where status=5 and uuid in (select uuid from $this->submd)) as offlinedown,
|
|
|
|
(select count(id) as num from offlineapp where ts_approved is not null) as offlinepass,
|
|
|
|
(select count(id) as num from offlineapp where ts_approved is not null and id in (select offlineappid from dataorder where uuid in (select uuid from $this->submd))) as offlinepass,
|
|
|
|
(select count(id) as num from offlineapp where ts_approved is null) as offlineunfinished,
|
|
|
|
(select count(id) as num from offlineapp where ts_approved is null and id in (select offlineappid from dataorder where uuid in (select uuid from $this->submd))) as offlineunfinished,
|
|
|
|
(select count(id) as num from dataorder where offlineappid>0 and status=-1) as offlinedenied,
|
|
|
|
(select count(id) as num from dataorder where offlineappid>0 and status=-1 and uuid in (select uuid from $this->submd)) as offlinedenied,
|
|
|
|
(select count(id) as num from onlineapp) as onlineapp";
|
|
|
|
(select count(id) as num from onlineapp and id in (select onlineappid from dataorder where uuid in (select uuid from $this->submd))) as onlineapp";
|
|
|
|
$this->view->stat=$this->db->fetchRow($sql);
|
|
|
|
$this->view->stat=$this->db->fetchRow($sql);
|
|
|
|
|
|
|
|
|
|
|
|
//下载量统计
|
|
|
|
//下载量统计
|
|
|
|
$sql = "select sum(num) as num from (select m.filesize/1024 as num,m.title,d.userid from dataorder d left join metadata m on d.uuid=m.uuid where (d.status=0 or d.status=5) and m.filesize>0 group by m.title,d.userid,m.filesize) as t";
|
|
|
|
$sql = "select sum(num) as num from (select m.filesize/1024 as num,m.title,d.userid from dataorder d left join $this->submd m on d.uuid=m.uuid where (d.status=0 or d.status=5) and m.filesize>0 group by m.title,d.userid,m.filesize) as t";
|
|
|
|
$res = $this->db->query($sql);
|
|
|
|
$res = $this->db->query($sql);
|
|
|
|
$allsize = $res->fetch();
|
|
|
|
$allsize = $res->fetch();
|
|
|
|
$this->view->allsize = $allsize;
|
|
|
|
$this->view->allsize = $allsize;
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "select sum(num) as num from (select m.filesize/1024 as num,m.title,d.userid from dataorder d left join metadata m on d.uuid=m.uuid where d.status=5 and m.filesize>0 group by m.title,d.userid,m.filesize) as t";
|
|
|
|
$sql = "select sum(num) as num from (select m.filesize/1024 as num,m.title,d.userid from dataorder d left join $this->submd m on d.uuid=m.uuid where d.status=5 and m.filesize>0 group by m.title,d.userid,m.filesize) as t";
|
|
|
|
$res = $this->db->query($sql);
|
|
|
|
$res = $this->db->query($sql);
|
|
|
|
$offlinesize = $res->fetch();
|
|
|
|
$offlinesize = $res->fetch();
|
|
|
|
$this->view->offlinesize = $offlinesize;
|
|
|
|
$this->view->offlinesize = $offlinesize;
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "select sum(num) as num from (select m.filesize/1024 as num,m.title,d.userid from dataorder d left join metadata m on d.uuid=m.uuid where d.status=0 and m.filesize>0 group by m.title,d.userid,m.filesize) as t";
|
|
|
|
$sql = "select sum(num) as num from (select m.filesize/1024 as num,m.title,d.userid from dataorder d left join $this->submd m on d.uuid=m.uuid where d.status=0 and m.filesize>0 group by m.title,d.userid,m.filesize) as t";
|
|
|
|
$res = $this->db->query($sql);
|
|
|
|
$res = $this->db->query($sql);
|
|
|
|
$onlinesize = $res->fetch();
|
|
|
|
$onlinesize = $res->fetch();
|
|
|
|
$this->view->onlinesize = $onlinesize;
|
|
|
|
$this->view->onlinesize = $onlinesize;
|
|
|
@ -65,7 +66,7 @@ class Admin_StatController extends Zend_Controller_Action
|
|
|
|
where d.offlineappid>0 and o.unit is not null and d.status>4";*/
|
|
|
|
where d.offlineappid>0 and o.unit is not null and d.status>4";*/
|
|
|
|
//各单位下载情况,统计的离线申请数据次数
|
|
|
|
//各单位下载情况,统计的离线申请数据次数
|
|
|
|
$sql = "select count(o.id) as num,o.unit from offlineapp o
|
|
|
|
$sql = "select count(o.id) as num,o.unit from offlineapp o
|
|
|
|
where o.unit is not null ";
|
|
|
|
where o.unit is not null and o.id in (select offlineappid from dataorder where uuid in (select uuid from $this->submd))";
|
|
|
|
if ($y)
|
|
|
|
if ($y)
|
|
|
|
$sql.=" and extract(year from o.ts_created)='$y'";
|
|
|
|
$sql.=" and extract(year from o.ts_created)='$y'";
|
|
|
|
$sql.=" group by o.unit";
|
|
|
|
$sql.=" group by o.unit";
|
|
|
@ -75,7 +76,8 @@ class Admin_StatController extends Zend_Controller_Action
|
|
|
|
//各单位在线下载情况
|
|
|
|
//各单位在线下载情况
|
|
|
|
$sql = "select count(d.id) as num,o.unit from dataorder d
|
|
|
|
$sql = "select count(d.id) as num,o.unit from dataorder d
|
|
|
|
left join onlineapp o on o.id=d.onlineappid
|
|
|
|
left join onlineapp o on o.id=d.onlineappid
|
|
|
|
where d.onlineappid>0 and o.unit is not null";
|
|
|
|
where d.onlineappid>0 and o.unit is not null
|
|
|
|
|
|
|
|
and d.uuid in (select uuid from $this->submd)";
|
|
|
|
if ($y)
|
|
|
|
if ($y)
|
|
|
|
$sql.=" and extract(year from o.ts_created)='$y'";
|
|
|
|
$sql.=" and extract(year from o.ts_created)='$y'";
|
|
|
|
$sql.=" group by o.unit";
|
|
|
|
$sql.=" group by o.unit";
|
|
|
|