This commit is contained in:
avene 2018-06-23 18:41:37 +08:00
parent c701107f1a
commit a4932e2b0a
1 changed files with 14 additions and 2 deletions

View File

@ -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();