增加doi的搜索功能
This commit is contained in:
parent
734327fa82
commit
d9d6177a91
|
@ -3626,7 +3626,8 @@ class Admin_DataController extends Zend_Controller_Action
|
|||
{
|
||||
$ac = $this->_getParam('ac');
|
||||
$submit = $this->_getParam('submit');
|
||||
$uuid = $this->_getParam('uuid');
|
||||
$uuid = $this->_getParam('uuid');
|
||||
$q=$this->_getParam('q');
|
||||
|
||||
include_once("data/Doi.php");
|
||||
$doi = new Doi($this->db);
|
||||
|
@ -3636,7 +3637,7 @@ class Admin_DataController extends Zend_Controller_Action
|
|||
{
|
||||
if(empty($uuid))
|
||||
{
|
||||
$rows = $doi->fetch();
|
||||
$rows = $doi->fetch(0,$q);
|
||||
view::addPaginator($rows,$this->view,$this->_request);
|
||||
}else{
|
||||
$this->_redirect('/admin/data/doi/ac/edit/?uuid='.$uuid);
|
||||
|
|
|
@ -12,16 +12,25 @@ class Doi extends Zend_Controller_Plugin_Abstract
|
|||
$this->db = $db;
|
||||
}
|
||||
|
||||
function fetch($uid=0)
|
||||
function fetch($uid=0,$keyword='')
|
||||
{
|
||||
$wheresql=' 1=1 ';
|
||||
if(!empty($keyword))
|
||||
{
|
||||
if(preg_match("/\'/",$keyword))
|
||||
{
|
||||
$keyword = preg_replace("/\'/","''",$keyword);
|
||||
}
|
||||
$wheresql.=" and d.title like '%$keyword%'";
|
||||
}
|
||||
if(empty($uid))
|
||||
{
|
||||
$sql = "SELECT * FROM ".$this->tbl_doi." ORDER BY ts_published desc,ts_submitted desc,ts_created DESC";
|
||||
$sql = "SELECT * FROM ".$this->tbl_doi." d where ".$wheresql."ORDER BY d.ts_published desc,d.ts_submitted desc,d.ts_created DESC";
|
||||
}else{
|
||||
$sql = "SELECT doi.* FROM ".$this->tbl_doi." doi
|
||||
LEFT JOIN mdauthor a ON doi.uuid=a.uuid
|
||||
WHERE a.userid=".$uid." AND a.status>0
|
||||
ORDER BY ts_published desc,ts_submitted desc,ts_created DESC
|
||||
$sql = "SELECT d.* FROM ".$this->tbl_doi." d
|
||||
LEFT JOIN mdauthor a ON d.uuid=a.uuid
|
||||
WHERE a.userid=".$uid." AND a.status>0 and ".$wheresql."
|
||||
ORDER BY d.ts_published desc,d.ts_submitted desc,d.ts_created DESC
|
||||
";
|
||||
}
|
||||
$rs = $this->db->query($sql);
|
||||
|
|
Loading…
Reference in New Issue