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 "