相关数据采用主题关键词搜索

This commit is contained in:
wlx 2011-11-08 15:12:28 +00:00
parent 3a09517db8
commit 2ca228b747
1 changed files with 2 additions and 2 deletions

View File

@ -590,8 +590,8 @@ class DataController extends Zend_Controller_Action
$sql="select u.* from uselimit u left join mdlimit m on u.id=m.lid where m.uuid=?";
$this->view->uselimits=$this->db->fetchAll($sql,array($uuid));
//相关元数据,根据同名关键词实现
//$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10";
$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=?) and kw.id<>? limit 10";
$sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10";
//$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=?) and kw.id<>? limit 10";
$this->view->related=$this->db->fetchAll($sql,array($id,$id));
//相关文献
$sql="select a.*,array_to_string(array(select author from knl_author t where t.item_id=a.item_id order by place asc),'; ') as author from knl_article a where (";