This commit is contained in:
parent
c701107f1a
commit
a4932e2b0a
|
@ -52,8 +52,20 @@ class DataController extends Zend_Controller_Action
|
|||
//最新10个入库数据
|
||||
$state=$this->db->query('select id,uuid,title,ts_published,description from normalmetadata order by id desc limit 8');
|
||||
$this->view->metadata = $state->fetchAll();
|
||||
//特色数据
|
||||
|
||||
//特色数据
|
||||
|
||||
$page=(int)$this->_request->getParam('page');
|
||||
if (empty($page)) $page=1;
|
||||
$limit=15;
|
||||
$offset=$limit*($page-1);
|
||||
$state=$this->db->query('select count(*) from normalmetadata');
|
||||
$row=$state->fetchAll();
|
||||
$sum=$row[0]['count'];
|
||||
$select=$this->db->select();
|
||||
$select->from('normalmetadata','*')->joinLeft('mdstat','normalmetadata.uuid=mdstat.uuid', ['viewed','downloaded'])->where('datatype=0')->order('title')->limitPage($page,$limit);
|
||||
$this->view->metadata = $this->db->fetchAll($select);
|
||||
|
||||
view::addPaginator($select, $this);
|
||||
//服务
|
||||
$l=new mydir($this->view->config->paths->newsletter,"newsletter_*.pdf");
|
||||
$this->view->newsletter=$l->getLast();
|
||||
|
|
Loading…
Reference in New Issue