From bac94c2dc9465afd684c7f8e74a0c9647d54afcd Mon Sep 17 00:00:00 2001 From: wlx Date: Sat, 24 Sep 2011 13:39:02 +0000 Subject: [PATCH] =?UTF-8?q?=E5=89=94=E9=99=A4=E7=94=A8=E6=88=B7=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=8B=E8=BD=BD=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/StatController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/controllers/StatController.php b/application/admin/controllers/StatController.php index 29ee5fcb..2ff83419 100644 --- a/application/admin/controllers/StatController.php +++ b/application/admin/controllers/StatController.php @@ -78,15 +78,15 @@ class Admin_StatController extends Zend_Controller_Action $this->view->unitonline = $unitonline; //下载量统计 - $sql = "select (sum(m.filesize)/1024) as num from dataorder d left join metadata m on d.uuid=m.uuid"; + $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"; $res = $this->db->query($sql); $allsize = $res->fetch(); $this->view->allsize = $allsize; - $sql = "select (sum(m.filesize)/1024) as num from dataorder d left join metadata m on d.uuid=m.uuid where d.offlineappid>0"; + $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"; $res = $this->db->query($sql); $offlinesize = $res->fetch(); $this->view->offlinesize = $offlinesize; - $sql = "select (sum(m.filesize)/1024) as num from dataorder d left join metadata m on d.uuid=m.uuid where d.onlineappid>0"; + $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"; $res = $this->db->query($sql); $onlinesize = $res->fetch(); $this->view->onlinesize = $onlinesize;