diff --git a/application/models/ISO19115.php b/application/models/ISO19115.php index 58c4507b..6a349daa 100755 --- a/application/models/ISO19115.php +++ b/application/models/ISO19115.php @@ -209,8 +209,14 @@ class ISO19115 //处理在线资源 if ($this->onlineresource) foreach($this->onlineresource as $resource) { - $sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)"; - $db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description'])); + if ($resource['name']) + { + $sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)"; + $db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description'])); + } else { + $sql="insert into onlineresource (uuid,linkage,protocol,description) values(?,?,?,?)"; + $db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['description'])); + } } //处理缩略图 if (!empty($this->thumbnail)) {