remove heihemetadata, fix index page error

This commit is contained in:
wlx 2014-03-06 07:38:06 +00:00
parent 325fa858e5
commit fbcdd9b9cb
2 changed files with 6 additions and 15 deletions

View File

@ -31,15 +31,6 @@
<div class="cp"> <div class="cp">
<span>选择年份:</span> <span>选择年份:</span>
<a href="/admin/stat/month/">所有年份</a> <a href="/admin/stat/month/">所有年份</a>
<a href="/admin/stat/month/y/2004">2004</a>
<a href="/admin/stat/month/y/2005">2005</a>
<a href="/admin/stat/month/y/2006">2006</a>
<a href="/admin/stat/month/y/2007">2007</a>
<a href="/admin/stat/month/y/2008">2008</a>
<a href="/admin/stat/month/y/2009">2009</a>
<a href="/admin/stat/month/y/2010">2010</a>
<a href="/admin/stat/month/y/2011">2011</a>
<a href="/admin/stat/month/y/2012">2012</a>
<a href="/admin/stat/month/y/2013">2013</a> <a href="/admin/stat/month/y/2013">2013</a>
<a href="/admin/stat/month/y/2014">2014</a> <a href="/admin/stat/month/y/2014">2014</a>
<a href="/admin/stat/month/y/2015">2015</a> <a href="/admin/stat/month/y/2015">2015</a>

View File

@ -18,7 +18,7 @@ class IndexController extends Zend_Controller_Action
$name=basename($this->view->newsletter,'.pdf'); $name=basename($this->view->newsletter,'.pdf');
list(,$this->view->newsletterno)=explode("_",$name); 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); $row=$this->db->fetchRow($sql);
$this->view->usernum=$row['usernum']; $this->view->usernum=$row['usernum'];
$this->view->metanum=$row['metanum']; $this->view->metanum=$row['metanum'];
@ -26,7 +26,7 @@ class IndexController extends Zend_Controller_Action
/*$sql='select count(*) from metadata'; /*$sql='select count(*) from metadata';
$row=$this->db->fetchRow($sql); $row=$this->db->fetchRow($sql);
$this->view->metanum=$row['count'];*/ $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); $rows=$this->db->fetchAll($sql);
foreach($rows as $row) foreach($rows as $row)
{ {
@ -42,12 +42,12 @@ class IndexController extends Zend_Controller_Action
$sql="select * from datasetcd order by random()"; $sql="select * from datasetcd order by random()";
$this->view->datasetcd=$this->db->fetchRow($sql); $this->view->datasetcd=$this->db->fetchRow($sql);
//下载最多数据(top 5) //下载最多数据(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->db->setFetchMode(Zend_Db::FETCH_OBJ);
$this->view->mdtop=$this->db->fetchAll($sql); $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); $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->mdrandom=$this->db->fetchRow($sql);
//搜索 //搜索
$this->view->addHelperPath('helper','Zend_View_Helper_'); $this->view->addHelperPath('helper','Zend_View_Helper_');
@ -85,7 +85,7 @@ class IndexController extends Zend_Controller_Action
$this->view->list_news = $rows; $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); $sth = $this->db->query($sql);
$this->view->dois = $sth->fetchAll(); $this->view->dois = $sth->fetchAll();