From fbcdd9b9cbe766adfc3a60ba3c6f5b407478158b Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 6 Mar 2014 07:38:06 +0000 Subject: [PATCH] remove heihemetadata, fix index page error --- application/admin/views/scripts/stat/month.phtml | 9 --------- application/default/controllers/IndexController.php | 12 ++++++------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/application/admin/views/scripts/stat/month.phtml b/application/admin/views/scripts/stat/month.phtml index 429cc39f..aaaa39ee 100644 --- a/application/admin/views/scripts/stat/month.phtml +++ b/application/admin/views/scripts/stat/month.phtml @@ -31,15 +31,6 @@
选择年份: 所有年份 - 2004 - 2005 - 2006 - 2007 - 2008 - 2009 - 2010 - 2011 - 2012 2013 2014 2015 diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php index aa86cdb5..92b5d467 100755 --- a/application/default/controllers/IndexController.php +++ b/application/default/controllers/IndexController.php @@ -18,7 +18,7 @@ class IndexController extends Zend_Controller_Action $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'; + $sql='select (select count(*) from users) as usernum,(select count(*) from normalmetadata) as metanum,(select count(*) from offlineapp where ts_approved is not null ) as offlinenum'; $row=$this->db->fetchRow($sql); $this->view->usernum=$row['usernum']; $this->view->metanum=$row['metanum']; @@ -26,7 +26,7 @@ class IndexController extends Zend_Controller_Action /*$sql='select count(*) from metadata'; $row=$this->db->fetchRow($sql); $this->view->metanum=$row['count'];*/ - $sql="select sum(filesize) as sum,datatype from heihemetadata group by datatype"; + $sql="select sum(filesize) as sum,datatype from normalmetadata group by datatype"; $rows=$this->db->fetchAll($sql); foreach($rows as $row) { @@ -42,12 +42,12 @@ class IndexController extends Zend_Controller_Action $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)"; + $sql="select uuid,title,id from normalmetadata where id in (select m.id from normalmetadata 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); $this->view->mdtop=$this->db->fetchAll($sql); - $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=1 group by m.id order by count(d.uuid) desc limit 5)"; + $sql="select uuid,title,id from normalmetadata where id in (select m.id from normalmetadata m left join dataorder d on m.uuid=d.uuid where m.datatype=1 group by m.id order by count(d.uuid) desc limit 5)"; $this->view->offlinemdtop=$this->db->fetchAll($sql); - $sql="select m.uuid,m.title,m.id,m.description from heihemetadata m left join thumbnail t on m.id=t.id where length(t.data)>2 order by random()"; + $sql="select m.uuid,m.title,m.id,m.description from normalmetadata m left join thumbnail t on m.id=t.id where length(t.data)>2 order by random()"; $this->view->mdrandom=$this->db->fetchRow($sql); //搜索 $this->view->addHelperPath('helper','Zend_View_Helper_'); @@ -85,7 +85,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 normalmetadata m on d.uuid=m.uuid where d.ts_published is not null order by ts_published desc limit 4"; $sth = $this->db->query($sql); $this->view->dois = $sth->fetchAll();