From a19a57a512b545e273d78caeb5ad0d62b7211bdd Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 13 Jun 2013 08:06:11 +0000 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=88=91=E8=B4=9F=E8=B4=A3?= =?UTF-8?q?=E7=9A=84=E8=AF=84=E5=AE=A1=E4=B8=AD=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E6=8C=89=E4=B8=93=E9=A2=98=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/ReviewController.php | 16 ++++++++---- .../admin/views/scripts/review/myreview.phtml | 26 ++++++++++++++----- application/models/data/Review.php | 11 +++++--- application/models/data/Source.php | 21 +++++++++++++++ 4 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 application/models/data/Source.php 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(); + } +}