diff --git a/application/models/ISO19115.php b/application/models/ISO19115.php index b80f8370..fde68f13 100755 --- a/application/models/ISO19115.php +++ b/application/models/ISO19115.php @@ -80,7 +80,7 @@ class ISO19115 public $mdContact; public $uuid; - public $doi; + public $doi=''; /** * 数据集标题 * 字符串 @@ -185,11 +185,10 @@ class ISO19115 } //save metadata into database - $sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created, - timebegin,timeend,west,south,north,east,doi) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - $sth=$db->prepare($sql); try { - $sth->execute(array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat, + $sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created, + timebegin,timeend,west,south,north,east,doi) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + $db->query($sql,array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat, $this->projection,$this->datatype,$this->filesize,$this->mdDateSt,$this->timebegin,$this->timeend,$this->geoBox['w'], $this->geoBox['s'],$this->geoBox['n'],$this->geoBox['e'],$this->doi)); $id=$db->lastInsertId('metadata','id'); @@ -232,15 +231,14 @@ class ISO19115 $sth=$db->prepare($sql); $sth->execute(array($ds['seriesName'])); $trow=$sth->fetch(); - $trow=$seriestable->fetchRow($where); if ($trow) - $sid=$trow['id']; + $sid=$trow->id; else { $sql="insert into series (name) values(?)"; $db->query($sql,array($ds['seriesName'])); $sid=$db->lastInsertId('series','id'); } - $sql="insert into dataserires (id,sid) values(?,?)"; + $sql="insert into dataseries (id,sid) values(?,?)"; $db->query($sql,array($id,$sid)); } //处理XML入库 @@ -313,7 +311,6 @@ class ISO19115 //数据重复插入,此处忽略所有错误 print $this->uuid.' has error: '.$e->getMessage().'
'; } - } function parse()