重新整理了后台统计功能,移除了未用到的链接
This commit is contained in:
parent
197cba1594
commit
7d8967a564
|
@ -17,11 +17,9 @@ class Admin_StatController extends Zend_Controller_Action
|
|||
$sql="select (select count(id) from users) as alluser,
|
||||
(select count(id) from normalmetadata) as alldata,
|
||||
(select count(id) as num from dataorder where status=0) as onlinedown,
|
||||
(select count(id) as num from dataorder where status=5) as offlinedown,
|
||||
(select count(id) as num from dataorder where offlineappid>0 and status>4) as offlinepass,
|
||||
(select count(id) as num from dataorder where offlineappid>0 and status in (2,3,4)) as offlineunfinished,
|
||||
(select count(id) as num from dataorder where offlineappid>0 and status=-1) as offlinedenied,
|
||||
(select count(id) as num from onlineapp) as onlineapp";
|
||||
(select count(id) as num from dataorder where offlineappid>0 and status=-1) as offlinedenied";
|
||||
$this->view->stat=$this->db->fetchRow($sql);
|
||||
|
||||
//下载量统计
|
||||
|
@ -39,13 +37,7 @@ class Admin_StatController extends Zend_Controller_Action
|
|||
$res = $this->db->query($sql);
|
||||
$onlinesize = $res->fetch();
|
||||
$this->view->onlinesize = $onlinesize;
|
||||
|
||||
/*$sql="select sum(configvalue::real)/1024/1024/1024 as num from g6ftpusersettings where userid in (select id from g6ftpusers where name like 'westdc%' or name='newwestdc') and configname='StatsDownloaded'";
|
||||
$res = $this->db->query($sql);
|
||||
$onlinesize = $res->fetch();
|
||||
$this->view->onlineg6size = $onlinesize;
|
||||
*/
|
||||
|
||||
|
||||
}//indexAction 首页
|
||||
|
||||
function unitAction()
|
||||
|
@ -80,7 +72,7 @@ class Admin_StatController extends Zend_Controller_Action
|
|||
if(!empty($y)||!is_numeric($y))
|
||||
{
|
||||
$n = date("Y",time());
|
||||
if($y<2004 || $y>$n)
|
||||
if($y<2011 || $y>$n)
|
||||
{
|
||||
$y=$n;
|
||||
}
|
||||
|
@ -140,94 +132,5 @@ class Admin_StatController extends Zend_Controller_Action
|
|||
{
|
||||
|
||||
}//webalizer 统计
|
||||
|
||||
function waterAction()
|
||||
{
|
||||
|
||||
$sql="select count(k.keyword) as num,d.status,k.keyword from dataorder d left join metadata m on d.uuid=m.uuid
|
||||
left join keyword k on m.id=k.id
|
||||
where (d.status=5 or d.status=-1) and m.source='0595169a-279e-4b95-819f-129d0ba4280d'
|
||||
and (k.keyword='航空遥感' or k.keyword='卫星遥感' or k.keyword='气象水文' or k.keyword='上游寒区水文试验区' or k.keyword='森林水文试验区' or k.keyword='中游干旱区水文试验区')
|
||||
group by k.keyword,d.status order by k.keyword desc,d.status desc";
|
||||
|
||||
$re =$this->db->query($sql);
|
||||
$type =$re->fetchAll();//按分类
|
||||
|
||||
$this->view->type = $type;
|
||||
|
||||
$sql="select count(extract(month from o.ts_created)) as c,extract(month from o.ts_created) as m,extract(year from o.ts_created) as y
|
||||
from offlineapp o left join dataorder d on d.offlineappid=o.id left join metadata m on m.uuid=d.uuid
|
||||
where m.source='0595169a-279e-4b95-819f-129d0ba4280d' and (d.status=3 or d.status=5 or d.status=-1)
|
||||
group by extract(month from o.ts_created),extract(year from o.ts_created)
|
||||
order by extract(year from o.ts_created),extract(month from o.ts_created)";
|
||||
|
||||
$re=$this->db->query($sql);
|
||||
$month=$re->fetchAll();
|
||||
|
||||
$this->view->month = $month;
|
||||
|
||||
$sql = "select
|
||||
extract(year from o.ts_created) as y,extract(month from o.ts_created) as m,
|
||||
count(extract(month from o.ts_created)) as c
|
||||
from
|
||||
(select distinct(o.id),o.ts_created
|
||||
from offlineapp o where o.datalist like '%黑河综合遥感联合试验%') as o
|
||||
group by extract(month from o.ts_created),extract(year from o.ts_created)
|
||||
order by extract(year from o.ts_created),extract(month from o.ts_created)";
|
||||
|
||||
$re=$this->db->query($sql);
|
||||
$order=$re->fetchAll();
|
||||
|
||||
$this->view->order = $order;
|
||||
|
||||
$sql = "select (sum(m.filesize)/1024) as n from dataorder d left join metadata m on d.uuid=m.uuid
|
||||
where d.status=5 and m.source='0595169a-279e-4b95-819f-129d0ba4280d'";
|
||||
|
||||
$re=$this->db->query($sql);
|
||||
$num=$re->fetchAll();
|
||||
|
||||
$this->view->num=$num;
|
||||
|
||||
|
||||
$sql = "select count(lower(o.unit)) as c,lower(o.unit) as u
|
||||
from offlineapp o left join dataorder d on d.offlineappid=o.id left join metadata m on m.uuid=d.uuid
|
||||
where m.source='0595169a-279e-4b95-819f-129d0ba4280d' and (d.status=5)
|
||||
group by lower(o.unit)
|
||||
order by lower(o.unit)";
|
||||
|
||||
$re=$this->db->query($sql);
|
||||
$units=$re->fetchAll();
|
||||
|
||||
$this->view->units=$units;
|
||||
|
||||
|
||||
$sql = "select count(t.unit) as c,t.unit from
|
||||
(select distinct(o.id),o.unit
|
||||
from offlineapp o left join dataorder d on d.offlineappid=o.id left join metadata m on m.uuid=d.uuid
|
||||
where m.source='0595169a-279e-4b95-819f-129d0ba4280d' and (d.status=5)
|
||||
) as t
|
||||
group by t.unit";
|
||||
|
||||
$re = $this->db->query($sql);
|
||||
$ounit= $re->fetchAll();
|
||||
|
||||
$this->view->ounit = $ounit;
|
||||
|
||||
//water 项目按月统计下载量
|
||||
$sql = "select (sum(m.filesize)/1024) as n,extract(month from d.ts_created) as m,extract(year from d.ts_created) as y from dataorder d left join metadata m on d.uuid=m.uuid
|
||||
where d.status=5 and m.source='0595169a-279e-4b95-819f-129d0ba4280d'
|
||||
group by extract(month from d.ts_created),extract(year from d.ts_created)
|
||||
order by extract(year from d.ts_created),extract(month from d.ts_created)";
|
||||
|
||||
$re = $this->db->query($sql);
|
||||
$dm = $re->fetchAll();
|
||||
|
||||
$this->view->dm = $dm;
|
||||
|
||||
|
||||
}//WATER项目
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
$this->breadcrumb()->setSeparator(' > ');
|
||||
?>
|
||||
<div id="leftPanel">
|
||||
<?= $this->partial('stat/left.phtml'); ?>
|
||||
<?= $this->partial('stat/left.phtml'); ?>
|
||||
<ul><li>
|
||||
<a href="/awstats/awstats.pl?config=deep">新窗口查看awstats web</a>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="rightPanel">
|
||||
<iframe src="http://westdc.westgis.ac.cn/awstats/awstats.pl?config=westdc" style="width:100%;height:700px;border:none;"></iframe>
|
||||
<iframe src="/awstats/awstats.pl?config=deep" style="width:100%;height:700px;border:none;"></iframe>
|
||||
</div>
|
|
@ -16,11 +16,9 @@
|
|||
<li>用户总数:<?php echo $this->stat['alluser']; ?>人</li>
|
||||
<li>元数据条数:<?php echo $this->stat['alldata']; ?>条</li>
|
||||
<li>在线数据下载次数:<?php echo $this->stat['onlinedown']; ?>条</li>
|
||||
<li>在线数据下载次数:<?php echo $this->stat['offlinedown']; ?>条</li>
|
||||
<li>已通过的离线申请:<?php echo $this->stat['offlinepass']; ?>次</li>
|
||||
<li>离线数据下载次数:<?php echo $this->stat['offlinepass']; ?>条</li>
|
||||
<li>未完成的离线申请:<?php echo $this->stat['offlineunfinished']; ?>次</li>
|
||||
<li>被拒绝的离线申请:<?php echo $this->stat['offlinedenied']; ?>人次</li>
|
||||
<li>有记录的在线下载数:<?php echo $this->stat['onlineapp']; ?>次</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="rightPanel">
|
||||
|
@ -31,22 +29,18 @@
|
|||
<tr><td width="200"></td><td width="100">单位:GB</td></tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>总下载数据量(估计量,偏大)</td>
|
||||
<td>总下载数据量</td>
|
||||
<td><?php echo round($this->allsize['num'],2);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>离线下载数据量(从09年4月)</td>
|
||||
<td>离线下载数据量</td>
|
||||
<td><?php echo round($this->offlinesize['num'],2);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>在线下载数据量(估计量,偏大)</td>
|
||||
<td>在线下载数据量</td>
|
||||
<td><?php echo round($this->onlinesize['num'],2);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>G6在线下载数据量(精确量)</td>
|
||||
<td><?php echo round($this->onlineg6size['num'],2);?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,6 +4,4 @@
|
|||
<li><a href="/admin/stat/unit">分单位统计</a></li>
|
||||
<li><a href="/admin/stat/month">分月统计</a></li>
|
||||
<li><a href="/admin/stat/awstatsweb">awstats web统计</a></li>
|
||||
<li><a href="/admin/stat/awstatsftp">awstats ftp统计</a></li>
|
||||
<li><a href="/admin/stat/webalizer">webalizer统计</a></li>
|
||||
</ul>
|
|
@ -28,15 +28,9 @@
|
|||
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.pointLabels.js"></script>
|
||||
<div class="cp">
|
||||
<span>选择年份:</span>
|
||||
<a href="/admin/stat/month/y/2004">2004</a>
|
||||
<a href="/admin/stat/month/y/2005">2005</a>
|
||||
<a href="/admin/stat/month/y/2006">2006</a>
|
||||
<a href="/admin/stat/month/y/2007">2007</a>
|
||||
<a href="/admin/stat/month/y/2008">2008</a>
|
||||
<a href="/admin/stat/month/y/2009">2009</a>
|
||||
<a href="/admin/stat/month/y/2010">2010</a>
|
||||
<a href="/admin/stat/month/y/2011">2011</a>
|
||||
<a href="/admin/stat/month/y/2012">2012</a>
|
||||
<a href="/admin/stat/month/y/2010">2012</a>
|
||||
<a href="/admin/stat/month/y/2011">2013</a>
|
||||
<a href="/admin/stat/month/y/2012">2014</a>
|
||||
</div>
|
||||
<div class="charts">
|
||||
<div class="title" id="title_online"><?php echo $this->y.'年按月在线下载量统计';?></div>
|
||||
|
|
Loading…
Reference in New Issue