修复数据文献管理错误

This commit is contained in:
wlx 2013-09-30 04:21:11 +00:00
parent b6bf8b1d40
commit 2b8c958bfa
2 changed files with 9 additions and 9 deletions

View File

@ -1101,14 +1101,14 @@ class Admin_DataController extends Zend_Controller_Action
}
} //搜索
else{
$select=$this->db->select();
$select->from('mdref',array('id as mdid','refid','place'))
->join('metadata','metadata.uuid=mdref.uuid')
->join('reference','reference.id=mdref.refid')
->order('metadata.ts_created desc')
->order('mdref.place');
$paginator = Zend_Paginator::factory($select);
else{
$sql="select m.title as mdtitle,m.uuid,mr.id as mdid,mr.refid,mr.place,r.reference
from mdref mr right join metadata m on mr.uuid=m.uuid
left join reference r on mr.refid=r.id
order by m.ts_created desc,mr.place";
$re=$this->db->query($sql);
$row=$re->fetchAll();
$paginator = Zend_Paginator::factory($row);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);
$paginator->setView($this->view);

View File

@ -56,7 +56,7 @@ foreach ($this->paginator as $item):
$i=0;
$u=$item['uuid'];
endif;
if ($i==0) echo '<div class="well"><h4>元数据:<a href="/data/'.$item['uuid'].'">'.$item['title'].'</a><a href="/admin/data/reference/add/1/uuid/'.$item['uuid'].'">添加</a></h4><ol>';
if ($i==0) echo '<div class="well"><h4>元数据:<a href="/data/'.$item['uuid'].'">'.$item['mdtitle'].'</a><a href="/admin/data/reference/add/1/uuid/'.$item['uuid'].'">添加</a></h4><ol>';
echo '<li>文献(<a href="/admin/data/reference/edit/'.$item['mdid'].'">编辑</a> <a href="/admin/data/reference/delete/'.$item['mdid'].'">删除</a> <a href="javascript:void(0);" class="order" rel="'.$item['mdid'].'" rev="'.$item['place'].'">排序</a>'.$item['place'].'. '.$item['reference'].'</li>';
endforeach;
echo '</ul>';