From cc4a11d4cd092d4559bee12b09f702050daeae58 Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 14 Jan 2015 06:32:30 +0000 Subject: [PATCH] remove unused code, fix doi problem --- application/default/controllers/IndexController.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php index aa86cdb5..87d2d461 100755 --- a/application/default/controllers/IndexController.php +++ b/application/default/controllers/IndexController.php @@ -12,11 +12,6 @@ class IndexController extends Zend_Controller_Action function indexAction() { - //数据通讯 - $l=new mydir($this->view->config->paths->newsletter,"newsletter_*.pdf"); - $this->view->newsletter=$l->getLast(); - $name=basename($this->view->newsletter,'.pdf'); - list(,$this->view->newsletterno)=explode("_",$name); //统计数据 $sql='select (select count(*) from users) as usernum,(select count(*) from heihemetadata) as metanum,(select count(*) from offlineapp where ts_approved is not null ) as offlinenum'; $row=$this->db->fetchRow($sql); @@ -38,9 +33,6 @@ class IndexController extends Zend_Controller_Action //特色推荐 $sql="select * from datafeature order by id desc"; $this->view->feature=$this->db->fetchRow($sql); - //特色数据集 - $sql="select * from datasetcd order by random()"; - $this->view->datasetcd=$this->db->fetchRow($sql); //下载最多数据(top 5) $sql="select uuid,title,id from heihemetadata where id in (select m.id from heihemetadata m left join dataorder d on m.uuid=d.uuid where m.datatype=0 group by m.id order by count(d.uuid) desc limit 5)"; $this->db->setFetchMode(Zend_Db::FETCH_OBJ); @@ -85,7 +77,7 @@ class IndexController extends Zend_Controller_Action $this->view->list_news = $rows; - $sql="select d.*,m.ts_published as publish_year from datadoi d right join heihemetadata m on d.uuid=m.uuid where d.ts_published is not null order by ts_published desc limit 4"; + $sql="select d.*,m.ts_published as publish_year from datadoi d right join heihemetadata m on d.uuid=m.uuid where length(d.title)>1 and d.ts_published is not null order by ts_published desc limit 4"; $sth = $this->db->query($sql); $this->view->dois = $sth->fetchAll();