将按单位统计的功能恢复为原来的离线、在线下载量统计。

This commit is contained in:
Li Jianxuan 2011-12-08 03:46:35 +00:00
parent 94392260ae
commit 8f89268643
2 changed files with 35 additions and 15 deletions

View File

@ -71,17 +71,25 @@ class Admin_StatController extends Zend_Controller_Action
function unitAction()
{
//各单位下载情况
$sql = "select count(o.id) as offline,count(ol.id) as online,o.unit from dataorder d
$sql = "select count(d.id) as num,o.unit from dataorder d
left join offlineapp o on o.id=d.offlineappid
left join onlineapp ol on ol.unit=o.unit
where (d.offlineappid>0 and o.unit is not null and d.status>4) or (d.onlineappid>0 and o.unit is not null)
group by o.unit
";
where d.offlineappid>0 and o.unit is not null and d.status>4
group by o.unit";
$fe = $this->db->query($sql);
$unitoffline = $fe->fetchAll();
$this->view->unitoffline = $unitoffline;
//各单位在线下载情况
$sql = "select count(d.id) as num,o.unit from dataorder d
left join onlineapp o on o.id=d.onlineappid
where d.onlineappid>0 and o.unit is not null
group by o.unit";
$fe = $this->db->query($sql);
$unitonline = $fe->fetchAll();
$this->view->unitonline = $unitonline;
}//分单位统计

View File

@ -20,25 +20,37 @@
<?= $this->partial('stat/left.phtml'); ?>
</div>
<div id="rightPanel">
<script language="javascript" type="text/javascript" src="/static/js/plot/jquery.jqplot.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.barRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.pieRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.categoryAxisRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.highlighter.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.pointLabels.js"></script>
<div class="cp">
<div class="cp">
</div>
<div id="unitdata">
</div>
<table>
<tr><td>单位名称</td><td>下载</td></tr>
<table style="float:left;">
<tr><td>单位名称</td><td>离线下载</td></tr>
<?php
foreach ($this->unitoffline as $k=>$v)
foreach($this->unitoffline as $k=>$v)
{
echo "<tr><td>{$v['unit']}</td><td>{$v['num']}</td></tr>";
}
?>
</table>
<table style="float:left;margin-left:20px;">
<tr><td>单位名称</td><td>在线下载</td></tr>
<?php
foreach ($this->unitonline as $k=>$v)
{
echo "<tr><td>{$v['unit']}</td><td>{$v['num']}</td></tr>";
}
?>
</table>
</div>