显示专家评审的元数据

This commit is contained in:
wlx 2011-10-23 12:52:46 +00:00
parent 929a9798b5
commit 692331a90b
1 changed files with 4 additions and 9 deletions

View File

@ -44,8 +44,9 @@ class ReviewController extends Zend_Controller_Action
$this->_redirect('/account/login/?href=/review/myreview'); $this->_redirect('/account/login/?href=/review/myreview');
} }
$wheresql = array(); $sql = "select md.title,md.uuid,md.id,md.description,s.status from metadata md left join mdstatus s on md.uuid=s.uuid
$wheresql[]=" r.userid='$uid' "; where md.uuid in (select uuid from mdexpertreview er where er.id=$uid
union select uuid from mdreview r where r.userid=$uid)";
if(!empty($keyword) && !empty($search)) if(!empty($keyword) && !empty($search))
{ {
@ -55,16 +56,10 @@ class ReviewController extends Zend_Controller_Action
$this->_redirect('/review/myreview'); $this->_redirect('/review/myreview');
}//非法请求过滤 }//非法请求过滤
$this->view->keyword = $keyword; $this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' "; $sql.= " and md.title like '%$keyword%' ";
// e.g. (... or md.author like '%keyword%') // e.g. (... or md.author like '%keyword%')
} }
$wheresql = join(' and ',$wheresql);
$sql = "select r.id,md.title,r.uuid from mdreview r
left join metadata md on md.uuid=r.uuid
where $wheresql";
$rs = $this->db->query($sql); $rs = $this->db->query($sql);
$rows = $rs->fetchAll(); $rows = $rs->fetchAll();