diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 1d0b83e7..1fe5ef7e 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -580,21 +580,27 @@ class Admin_ReviewController extends Zend_Controller_Action function myreviewAction(){ include_once("data/Review.php"); + include_once("data/Source.php"); include_once("helper/view.php"); $search=$this->_request->getParam('search'); - $keyword = $this->_request->getParam('keyword'); + $filter['keyword'] = $this->_request->getParam('keyword'); + $filter['code'] = $this->_request->getParam('code'); $review = new Review($this->db); - if(!empty($search) && !empty($keyword)) + if(!empty($search) && !empty($filter)) { - $rows = $review->adminReviews($keyword); - $this->view->keyword = $keyword; + $rows = $review->adminReviews($filter); + $this->view->keyword = $filter['keyword']; + $this->view->code = $filter['code']; }else{ $rows = $review->adminReviews(); } + + $source = new Source($this->db); + $this->view->source = $source->Fetch(); - view::addPaginator($rows,$this->view,$this->_request); + view::addPaginator($rows,$this,NULL,15); return true; }//我管理的元数据 diff --git a/application/admin/views/scripts/review/myreview.phtml b/application/admin/views/scripts/review/myreview.phtml index fec2fa9d..86d32cea 100644 --- a/application/admin/views/scripts/review/myreview.phtml +++ b/application/admin/views/scripts/review/myreview.phtml @@ -26,12 +26,26 @@ table thead tr th {background:#EBF2F6;color:#444;} - - + diff --git a/application/models/data/Review.php b/application/models/data/Review.php index 42dcd700..87b3e116 100644 --- a/application/models/data/Review.php +++ b/application/models/data/Review.php @@ -64,7 +64,7 @@ class Review extends Zend_Controller_Plugin_Abstract } //后台我负责的评审 - function adminReviews($keyword = "",$order="") + function adminReviews($filter = "",$order="") { include_once('helper/view.php'); $uid = view::User('id'); @@ -74,9 +74,13 @@ class Review extends Zend_Controller_Plugin_Abstract $wheresql[] = " m.status in (1,2,3,4) "; $wheresql[] = " u.id=$uid "; - if(!empty($keyword)) + if(isset($filter['keyword']) && !empty($filter['keyword'])) { - $wheresql[] = " md.title like '%$keyword%' "; + $wheresql[] = " md.title like '%".$filter['keyword']."%' "; + } + if(isset($filter['code']) && !empty($filter['code'])) + { + $wheresql[] = " s.id=".$filter['code']." "; } if(count($wheresql)>0) @@ -91,6 +95,7 @@ class Review extends Zend_Controller_Plugin_Abstract right join metadata md on md.uuid=m.uuid left join geonetworkmetadata g on m.uuid=g.uuid left join users u on u.id=m.userid + left join datasource s on s.uuid=md.uuid $wheresql order by m.status desc,m.ts_accepted desc"; diff --git a/application/models/data/Source.php b/application/models/data/Source.php new file mode 100644 index 00000000..023a005b --- /dev/null +++ b/application/models/data/Source.php @@ -0,0 +1,21 @@ +db = $db; + } + + function Fetch() + { + $sql = "SELECT * FROM ".$this->tbl_source.""; + $rs = $this->db->query($sql); + return $rs->fetchAll(); + } +}