diff --git a/module/Metadata/src/Metadata/Controller/IndexController.php b/module/Metadata/src/Metadata/Controller/IndexController.php index 92db9610..89c1d0db 100644 --- a/module/Metadata/src/Metadata/Controller/IndexController.php +++ b/module/Metadata/src/Metadata/Controller/IndexController.php @@ -147,7 +147,39 @@ class IndexController extends AbstractActionController { $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($order == "viewed") + $metadata->opt->order = "md.viewed"; + } + + 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' "); + } + $metadata->opt->where = array(' m.datatype=0 '); view::addPaginator($metadata->fetchAll(),$this,10,'layout/metadata/pagination/onlinelist'); @@ -158,7 +190,39 @@ class IndexController extends AbstractActionController { $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($order == "viewed") + $metadata->opt->order = "md.viewed"; + } + + 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' "); + } + $metadata->opt->where = array(' m.datatype=1 '); view::addPaginator($metadata->fetchAll(),$this,10,'layout/metadata/pagination/offlinelist');