From a83c3ee18f506501dd98b2a2ae8cb3e2a5c01708 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 24 Oct 2013 09:54:24 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9RIS=E4=B8=AD=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=A4=84=E6=A0=BC=E5=BC=8F=E5=A4=84=E7=90=86=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/module/Reference/Ris.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/application/module/Reference/Ris.php b/application/module/Reference/Ris.php index 849430cc..9e0facf3 100644 --- a/application/module/Reference/Ris.php +++ b/application/module/Reference/Ris.php @@ -140,7 +140,7 @@ class Ris } //将解析好的ris数据写入数据库 - public function pushToDataTable($data,$create_ref=false){ + public function pushToDataTable($data){ if(!is_array($data) || count($data) < 1) { @@ -162,13 +162,6 @@ class Ris $ref['ris'] = $this->makeRisData(array(0=>$this->ris_records[$k])); $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')); $id = $results->bottom(); @@ -179,8 +172,13 @@ class Ris $this->events()->trigger('deleteAuthor', $this, compact('id')); $this->events()->trigger('deleteTag', $this, compact('id')); + unset($ref['reference']); + $dbh->update($this->table->reference,$ref," id=$id "); } else { + + $ref['reference'] = $reference; + $id = $dbh->insert($this->table->reference,$ref,true); } @@ -231,7 +229,7 @@ class Ris //创建reference 字段 public function makeReferenceFlag($ref){ $str = array(); - isset($ref['author']) ? $str[] = $ref['author']:""; + isset($ref['author']) ? $str[] = join(",",$ref['author']):""; isset($ref['title']) ? $str[] = $ref['title']:""; isset($ref['year']) ? $str[] = $ref['year']:""; isset($ref['volume']) ? $str[] = $ref['volume']:"";