添加了排序和按单位查询功能
This commit is contained in:
parent
f33f58a49d
commit
6fa6a06734
|
@ -104,7 +104,36 @@ class IndexController extends AbstractActionController
|
||||||
{
|
{
|
||||||
$this->ViewModel->setTemplate("layout/metadata/datalist");
|
$this->ViewModel->setTemplate("layout/metadata/datalist");
|
||||||
|
|
||||||
$metadata = new \Westdc\Metadata\Metadata;
|
$order = $this->params()->fromQuery('order');
|
||||||
|
$sort = $this->params()->fromQuery('sort');
|
||||||
|
$source = $this->params()->fromQuery('source');
|
||||||
|
|
||||||
|
$metadata = new \Westdc\Metadata\Outlink;
|
||||||
|
|
||||||
|
if(!empty($order))
|
||||||
|
{
|
||||||
|
if($order == "ts_created")
|
||||||
|
$metadata->opt->order = "m.ts_created";
|
||||||
|
if($order == "title")
|
||||||
|
$metadata->opt->order = "m.title";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!empty($sort))
|
||||||
|
{
|
||||||
|
if($sort == "asc")
|
||||||
|
$metadata->opt->sort = "asc";
|
||||||
|
if($sort == "desc")
|
||||||
|
$metadata->opt->sort = "desc";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!empty($source))
|
||||||
|
{
|
||||||
|
$source = iconv("GB2312","UTF-8",$source);
|
||||||
|
if($source == "青海湖")
|
||||||
|
$metadata->opt->where = array(" ol.host='http://deep.qherc.org' ");
|
||||||
|
if($source == "三江源")
|
||||||
|
$metadata->opt->where = array(" ol.host='http://www.sanjiangyuan.org.cn' ");
|
||||||
|
}
|
||||||
|
|
||||||
view::addPaginator($metadata->fetchAll(),$this,10,'layout/metadata/pagination/browse');
|
view::addPaginator($metadata->fetchAll(),$this,10,'layout/metadata/pagination/browse');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue