后台添加文献排序功能,修改文献排序时where条件字段

This commit is contained in:
Li Jianxuan 2013-05-08 02:33:48 +00:00
parent 82a862d8fc
commit 01ef6f5cb6
4 changed files with 9 additions and 6 deletions

View File

@ -1087,10 +1087,11 @@ class Admin_DataController extends Zend_Controller_Action
else{
$select=$this->db->select();
$select->from('mdref',array('id as mdid','refid'))
$select->from('mdref',array('id as mdid','refid','place'))
->join('metadata','metadata.uuid=mdref.uuid')
->join('reference','reference.id=mdref.refid')
->order('metadata.title');
->order('metadata.title')
->order('mdref.place');
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);

View File

@ -8,6 +8,8 @@
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('数据文献关联管理');
$this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'colorbox');
$this->theme->AppendModel($this,"author-literature");
?>
<div id="leftPanel">
<?= $this->partial('data/left.phtml'); ?>
@ -56,7 +58,7 @@ foreach ($this->paginator as $item):
$u=$item['uuid'];
endif;
if ($i==0) echo '<ul><li>元数据:<a href="/data/'.$item['uuid'].'">'.$item['title'].'</a><a href="/admin/data/reference/add/1/uuid/'.$item['uuid'].'">添加</a></li>';
echo '<li>文献(<a href="/admin/data/reference/edit/'.$item['mdid'].'">编辑</a> <a href="/admin/data/reference/delete/'.$item['mdid'].'">删除</a>'.$item['reference'].'</li>';
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['reference'].'</li>';
endforeach;
echo '</ul>';
?>

View File

@ -39,7 +39,7 @@ $this->breadcrumb()->setSeparator(' > ');
<p>
<a href="/author/literature/id/<?php echo $item['id'];?>">查看详细</a>
| <a href="javascript:void(0);" class="edit" rel="<?= $item['id'];?>">编辑</a>
| <a href="javascript:void(0);" class="order" rel="<?= $item['id'];?>" rev="<?= $item['place']?>">排序</a>
| <a href="javascript:void(0);" class="order" rel="<?= $item['mrid'];?>" rev="<?= $item['place']?>">排序</a>
| <a onclick="return confirm('是否确定删除该文献?');" href="javascript:action('delete&id=<?php echo $item['id'];?>','<?php echo $item['uuid'];?>');" class="more">删除</a>
| <a href="/author/literature/ac/add/uuid/<?php echo $item['uuid'];?>" class="more iframe">添加文献</a>
</p>

View File

@ -53,7 +53,7 @@ class Literature extends Author
function byuuid($uuid){
include_once("helper/view.php");
$uid = view::User('id');
$sql = "SELECT md.title,md.uuid,r.id,r.reference,r.link,mr.place FROM mdref mr
$sql = "SELECT md.title,md.uuid,r.id,r.reference,r.link,mr.place,mr.id as mrid FROM mdref mr
LEFT JOIN metadata md ON md.uuid=mr.uuid
LEFT JOIN mdauthor a ON md.uuid=a.uuid
left join reference r on mr.refid=r.id
@ -86,7 +86,7 @@ class Literature extends Author
'place' => $order
);
$s = $dbh->update("mdref",$data," refid=$id ",false);
$s = $dbh->update("mdref",$data," id=$id ",false);
return $s;
}