修改RIS中导入处格式处理的bug
This commit is contained in:
parent
dacbff71c5
commit
a83c3ee18f
|
@ -140,7 +140,7 @@ class Ris
|
||||||
}
|
}
|
||||||
|
|
||||||
//将解析好的ris数据写入数据库
|
//将解析好的ris数据写入数据库
|
||||||
public function pushToDataTable($data,$create_ref=false){
|
public function pushToDataTable($data){
|
||||||
|
|
||||||
if(!is_array($data) || count($data) < 1)
|
if(!is_array($data) || count($data) < 1)
|
||||||
{
|
{
|
||||||
|
@ -162,13 +162,6 @@ class Ris
|
||||||
$ref['ris'] = $this->makeRisData(array(0=>$this->ris_records[$k]));
|
$ref['ris'] = $this->makeRisData(array(0=>$this->ris_records[$k]));
|
||||||
$reference = $this->makeReferenceFlag($ref);
|
$reference = $this->makeReferenceFlag($ref);
|
||||||
|
|
||||||
if ($create_ref)
|
|
||||||
{
|
|
||||||
$ref['reference'] = $reference;
|
|
||||||
}else{
|
|
||||||
$ref['reference'] = $ref['title'].'---'.date("Y-m-d H:i:s").".".microtime().rand();
|
|
||||||
}
|
|
||||||
|
|
||||||
$results = $this->events()->trigger('checkLoad', $this, compact('ref'));
|
$results = $this->events()->trigger('checkLoad', $this, compact('ref'));
|
||||||
$id = $results->bottom();
|
$id = $results->bottom();
|
||||||
|
|
||||||
|
@ -179,8 +172,13 @@ class Ris
|
||||||
$this->events()->trigger('deleteAuthor', $this, compact('id'));
|
$this->events()->trigger('deleteAuthor', $this, compact('id'));
|
||||||
$this->events()->trigger('deleteTag', $this, compact('id'));
|
$this->events()->trigger('deleteTag', $this, compact('id'));
|
||||||
|
|
||||||
|
unset($ref['reference']);
|
||||||
|
|
||||||
$dbh->update($this->table->reference,$ref," id=$id ");
|
$dbh->update($this->table->reference,$ref," id=$id ");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
$ref['reference'] = $reference;
|
||||||
|
|
||||||
$id = $dbh->insert($this->table->reference,$ref,true);
|
$id = $dbh->insert($this->table->reference,$ref,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +229,7 @@ class Ris
|
||||||
//创建reference 字段
|
//创建reference 字段
|
||||||
public function makeReferenceFlag($ref){
|
public function makeReferenceFlag($ref){
|
||||||
$str = array();
|
$str = array();
|
||||||
isset($ref['author']) ? $str[] = $ref['author']:"";
|
isset($ref['author']) ? $str[] = join(",",$ref['author']):"";
|
||||||
isset($ref['title']) ? $str[] = $ref['title']:"";
|
isset($ref['title']) ? $str[] = $ref['title']:"";
|
||||||
isset($ref['year']) ? $str[] = $ref['year']:"";
|
isset($ref['year']) ? $str[] = $ref['year']:"";
|
||||||
isset($ref['volume']) ? $str[] = $ref['volume']:"";
|
isset($ref['volume']) ? $str[] = $ref['volume']:"";
|
||||||
|
|
Loading…
Reference in New Issue