From 897b6de6a979aea10ed87f60fd90f563a20786da Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 2 Dec 2011 03:04:10 +0000 Subject: [PATCH] =?UTF-8?q?heihe=20view=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E7=BB=99=E6=88=91=E6=8E=A8=E8=8D=90=E7=9A=84=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/DataController.php | 5 +++++ application/default/views/scripts/heihe/view.phtml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 6b009379..40b3d2f6 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -589,6 +589,11 @@ class DataController extends Zend_Controller_Action //数据限制信息 $sql="select u.* from uselimit u left join mdlimit m on u.id=m.lid where m.uuid=?"; $this->view->uselimits=$this->db->fetchAll($sql,array($uuid)); + //相关下载 + $sql = "select d.uuid,count(distinct(d.userid)) as downtimes,m.title from dataorder d left join metadata m on d.uuid=m.uuid where d.userid in ( + select distinct(userid) from dataorder where uuid=? and status in (0,5) + ) and d.uuid<>? and length(m.title)>2 group by d.uuid,m.title order by count(distinct(d.userid)) desc limit 10;"; + $this->view->downlists = $this->db->fetchAll($sql,array($uuid,$uuid)); //相关文献 $sql="select a.*,array_to_string(array(select author from knl_author t where t.item_id=a.item_id order by place asc),'; ') as author from knl_article a where ("; foreach($this->view->keys as $k) diff --git a/application/default/views/scripts/heihe/view.phtml b/application/default/views/scripts/heihe/view.phtml index 7f4b0e44..73988f96 100755 --- a/application/default/views/scripts/heihe/view.phtml +++ b/application/default/views/scripts/heihe/view.phtml @@ -266,6 +266,11 @@ endforeach;

申请了本条数据的用户,通常他们还申请了:

+downlists as $v){ + echo "
  • uuid."\">".$v->title.' (下载人数:'.$v->downtimes.')
  • '; + } +?>