diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index db6809b7..bc060e88 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -45,8 +45,10 @@ class DataController extends Zend_Controller_Action $k5=$state->fetchAll(); $this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5); //最新10个入库数据 - $state=$this->db->query("select id,uuid,title from {$this->submd} order by id desc limit 10"); + $state=$this->db->query("select id,uuid,title,ts_created from {$this->submd} order by ts_created desc limit 10"); $this->view->metadata = $state->fetchAll(); + $state=$this->db->query("select m.id,m.uuid,m.title,s.viewed from {$this->submd} m left join mdstat s on m.uuid=s.uuid order by s.viewed desc limit 10"); + $this->view->viewedmd = $state->fetchAll(); //服务 $searchform=new SearchForm(); $this->view->searchform=$searchform; @@ -1798,11 +1800,11 @@ class DataController extends Zend_Controller_Action $page=(int)$this->_request->getParam('page'); if (empty($page)) $page=1; $offset=$this->limit*($page-1); - $state=$this->db->query("select count(*) from normalmetadata"); + $state=$this->db->query("select count(*) from $this->submd"); $row=$state->fetchAll(); $sum=$row[0]['count']; $select=$this->db->select(); - $select->from('normalmetadata as m','m.*') + $select->from($this->submd.' as m','m.*') ->order('m.title desc')->limitPage($page,9); $this->view->metadata = $this->db->fetchAll($select); $this->view->page=new Pagination($sum,$page,$this->limit); diff --git a/application/default/views/scripts/data/index.phtml b/application/default/views/scripts/data/index.phtml index 942f1c1b..25ba7ba0 100755 --- a/application/default/views/scripts/data/index.phtml +++ b/application/default/views/scripts/data/index.phtml @@ -7,6 +7,7 @@