优化后台文献功能
This commit is contained in:
parent
3ba5060d26
commit
ad9d92de67
|
@ -99,8 +99,8 @@ table thead tr th {background:#EBF2F6;}
|
|||
<td><?= $this->referenceType[$item['reftype']] ?></td>
|
||||
<td><?= $item['place'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="$('#mdref')[0].reset();mdref.edit('',<?= $item['id']?>,'<?= $this->uuid; ?>',<?= $item['reftype']?>,<?= $item['place']?>)">编辑</a>
|
||||
<a href="/admin/data/ref/ac/deletemdref/mrid/<?= $item['mrid']?>">删除</a>
|
||||
<a href="javascript:void(0);" onclick="$('#mdref')[0].reset();mdref.edit(<?= $item['mrid']?>,<?= $item['id']?>,'<?= $this->uuid; ?>',<?= $item['reftype']?>,<?= $item['place']?>)">编辑</a>
|
||||
<a href="/admin/data/ref/ac/deletemdref/mrid/<?= $item['mrid']?>">移除</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<ul class="nav nav-tabs">
|
||||
<?php if (!empty($this->uuid)) : ?>
|
||||
<li class="active"><a href="/admin/data/ref">数据文献</a></li>
|
||||
<li class="active"><a href="/admin/data/ref/uuid/<?= $this->uuid ?>">数据文献</a></li>
|
||||
<?php endif; ?>
|
||||
<li <?= empty($this->ac) && empty($this->uuid) ? 'class="active"':"" ?>><a href="/admin/data/ref">浏览所有</a></li>
|
||||
<li <?= $this->ac=="water" ? 'class="active"':"" ?>><a href="/admin/data/ref/ac/water">WATER文献</a></li>
|
||||
|
|
|
@ -332,7 +332,38 @@ class Reference
|
|||
$order = "ref.{$this->order} {$this->sort}";
|
||||
}
|
||||
|
||||
$sql="select distinct ref.*,r.reftype,r.place,r.id as mrid from {$this->table->reference} ref left join mdref r on ref.id=r.refid
|
||||
$sql="select distinct ref.*,r.reftype,r.place,r.id as mrid from {$this->table->reference} ref left join {$this->table->metadata_reference} r on ref.id=r.refid
|
||||
$wheresql
|
||||
ORDER BY $order";
|
||||
$rs=$this->db->query($sql);
|
||||
return $rs->fetchAll();
|
||||
}
|
||||
|
||||
//Get references with data UUID
|
||||
public function fetchReferencesWithUUID($uuid)
|
||||
{
|
||||
$wheresql = array();
|
||||
//$wheresql[]=" r.uuid='$uuid' ";
|
||||
if(!empty($this->keyword))
|
||||
{
|
||||
$wheresql[] = " (ref.title LIKE '%{$this->keyword}%' OR ref.reference LIKE '%{$this->keyword}%') ";
|
||||
}
|
||||
if(count($wheresql)>0)
|
||||
{
|
||||
$wheresql = " WHERE ".join(" AND ",$wheresql);
|
||||
}else{
|
||||
$wheresql = "";
|
||||
}
|
||||
|
||||
if(empty($this->order))
|
||||
{
|
||||
$order = "ref.year,ref.title";
|
||||
}else{
|
||||
$order = "ref.{$this->order} {$this->sort}";
|
||||
}
|
||||
|
||||
$sql="select distinct ref.*,r.reftype,r.place,r.id as mrid from {$this->table->reference} ref left join
|
||||
(select * from {$this->table->metadata_reference} r where uuid='$uuid') r on ref.id=r.refid
|
||||
$wheresql
|
||||
ORDER BY $order";
|
||||
$rs=$this->db->query($sql);
|
||||
|
|
Loading…
Reference in New Issue