From 8f8926864332da6f43f98e17a9cf369b2d82108b Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 8 Dec 2011 03:46:35 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=8C=89=E5=8D=95=E4=BD=8D=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=9A=84=E5=8A=9F=E8=83=BD=E6=81=A2=E5=A4=8D=E4=B8=BA?= =?UTF-8?q?=E5=8E=9F=E6=9D=A5=E7=9A=84=E7=A6=BB=E7=BA=BF=E3=80=81=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E8=BD=BD=E9=87=8F=E7=BB=9F=E8=AE=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/StatController.php | 18 ++++++++--- .../admin/views/scripts/stat/unit.phtml | 32 +++++++++++++------ 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/application/admin/controllers/StatController.php b/application/admin/controllers/StatController.php index 4bf8cd2a..4016e379 100644 --- a/application/admin/controllers/StatController.php +++ b/application/admin/controllers/StatController.php @@ -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; + }//分单位统计 diff --git a/application/admin/views/scripts/stat/unit.phtml b/application/admin/views/scripts/stat/unit.phtml index bdf432a5..88764e80 100644 --- a/application/admin/views/scripts/stat/unit.phtml +++ b/application/admin/views/scripts/stat/unit.phtml @@ -20,25 +20,37 @@ partial('stat/left.phtml'); ?>
- - - - - - -
+
+
+
- - +
单位名称下载数
+ unitoffline as $k=>$v) - foreach($this->unitoffline as $k=>$v) { + echo ""; + } ?>
单位名称离线下载
{$v['unit']}{$v['num']}
+ + + unitonline as $k=>$v) + + { + + echo ""; + + } + + ?> +
单位名称在线下载
{$v['unit']}{$v['num']}
+
\ No newline at end of file