update pagination

This commit is contained in:
jack 2018-05-12 16:40:01 +08:00
parent f30ff25a53
commit f81566f050
3 changed files with 18 additions and 22 deletions

View File

@ -104,7 +104,7 @@ class DataController extends Zend_Controller_Action
$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::addTextPaginator($select, $this);
view::addPaginator($select, $this);
}
function offlinelistAction()
{
@ -118,7 +118,7 @@ class DataController extends Zend_Controller_Action
$select=$this->db->select();
$select->from('normalmetadata','*')->joinLeft('mdstat','normalmetadata.uuid=mdstat.uuid', ['viewed','downloaded'])->where('datatype=1')->order('title')->limitPage($page,$limit);
view::addTextPaginator($select, $this);
view::addPaginator($select, $this);
}
//展示最近20条离线神情记录情况
function offlineappAction()
@ -205,7 +205,7 @@ class DataController extends Zend_Controller_Action
$select=$this->db->select();
$select->from('metadata','*')->joinLeft('mdstat','metadata.uuid=mdstat.uuid', ['viewed','downloaded'])->order('id desc')->limitPage($page,$limit);
view::addTextPaginator($select, $this);
view::addPaginator($select, $this);
}
function tagAction()
@ -246,7 +246,7 @@ class DataController extends Zend_Controller_Action
//$state=$db->query($sql);
$this->view->metadata=$this->db->fetchAll($select);
// $this->view->page=new Pagination($sum,$page,$limit);
view::addTextPaginator($select, $this);
view::addPaginator($select, $this);
}
}
/*
@ -306,7 +306,7 @@ class DataController extends Zend_Controller_Action
->limitPage($page,$limit);
if (!empty($keyword)) $select->join('keyword','keyword.id=normalmetadata.id')->where('keyword.keyword=?',$keyword);
view::addTextPaginator($select, $this);
view::addPaginator($select, $this);
//$this->view->showtools=($sum>$page)?true:false;
@ -344,7 +344,7 @@ class DataController extends Zend_Controller_Action
->where('c.code=?',$code)
->order('m.title')
->limitPage($page,$this->limit);
view::addTextPaginator($select, $this);
view::addPaginator($select, $this);
} else {
//提供全部分类列表
}
@ -1989,7 +1989,7 @@ where ds.uuid=? )) ) a ) p on r.id=p.refid order by p.place";
$select->from('normalmetadata as m','m.*')
->order('m.title desc')->limitPage($page,9);
view::addTextPaginator($select, $this);
view::addPaginator($select, $this);
}
/*
@ -2168,7 +2168,7 @@ where ds.uuid=? )) ) a ) p on r.id=p.refid order by p.place";
$sth->execute(array($name));
$rows = $sth->fetchAll();
view::addTextPaginator($rows, $this);
view::addPaginator($rows, $this);
} else {
//提供全部分类列表
}
@ -2261,7 +2261,7 @@ where ds.uuid=? )) ) a ) p on r.id=p.refid order by p.place";
$sth->execute(array($id));
$rows = $sth->fetchAll();
view::addTextPaginator($rows, $this);
view::addPaginator($rows, $this);
} else {
//已经认证过的数据作者
$sql="select u.username,u.realname,u.id,count(u.id) as count from mdauthor a left join users u on a.userid=u.id where a.status=1 and a.uuid in (select uuid from normalmetadata) group by u.id,u.username,u.realname";
@ -2269,7 +2269,7 @@ where ds.uuid=? )) ) a ) p on r.id=p.refid order by p.place";
$sth->execute();
$rows = $sth->fetchAll();
view::addTextPaginator($rows, $this);
view::addPaginator($rows, $this);
}
} else if ($ac=='unverified' || empty($ac)) {
//未认证的数据作者
@ -2283,14 +2283,14 @@ where ds.uuid=? )) ) a ) p on r.id=p.refid order by p.place";
$sth = $this->db->prepare($sql);
$sth->execute(array($id));
$rows = $sth->fetchAll();
view::addTextPaginator($rows, $this);
view::addPaginator($rows, $this);
} else {
//列出所有作者
$sql="select distinct responsible.individual as username,responsible.id from responsible left join role on role.resid=responsible.id where role.role in ('pointOfContact','resourceProvider','owner')";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
view::addTextPaginator($rows, $this);
view::addPaginator($rows, $this);
}
}
}

View File

@ -1,6 +1,5 @@
<?php if ($this->pageCount): ?>
<div class="pagination">
<ul>
<ul class="pagination">
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<li><a href="<?= $this->url(array('page' => $this->previous)); ?>?<?php echo $_SERVER["QUERY_STRING"];?>">&laquo;</a></li>
@ -23,6 +22,4 @@
<li class="disabled"><a href="javascript:;">&raquo;</a></li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>

View File

@ -28,4 +28,3 @@
<span><a href="#">返回顶部</a></span>
<?php endif; ?>