From 8e7c1b5048f0e234d63bcc29b467f18c2c55f460 Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 20 Oct 2011 06:56:01 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/WatermdController.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application/admin/controllers/WatermdController.php b/application/admin/controllers/WatermdController.php index abc83422..cc2e8c67 100644 --- a/application/admin/controllers/WatermdController.php +++ b/application/admin/controllers/WatermdController.php @@ -162,6 +162,9 @@ class Admin_WatermdController extends Zend_Controller_Action { $sql="select uuid,data from metadata where istemplate = 'n'"; $rows=$this->wdb->fetchAll($sql); + $this->view->deal=array(); + $sql="select update_filesize();"; + $this->db->exec($sql); foreach($rows as $k=>$row) { //do the replace @@ -173,24 +176,21 @@ class Admin_WatermdController extends Zend_Controller_Action $title_key=$xpath->query("//Metadata/dataIdInfo/idCitation/resTitle"); $title=$title_key->item(0)->nodeValue; $transize_path=$xpath->query("//Metadata/distInfo/distTranOps/transSize"); - $sql="select sum(file_size) as fsize from westdc_fileinfo where meta_uuid = ?"; + $sql="select filesize from metadata where uuid = ?"; $this->db->setFetchMode(Zend_Db::FETCH_OBJ); $row=$this->db->fetchRow($sql,array($uuid)); - //转换单位为MB - $msize=round($row->fsize/(1024*1024),2); - if($msize>10){ - $msize=round($size/(1024*1024),1); - } - $transize_path->item(0)->nodeValue=msize; - $new_data = $dom->saveXML($root->item(0)); + $transize_path->item(0)->nodeValue=$row->filesize; + $new_data = $dom->saveXML(); //防止错误 if (!empty($new_data)) { - $sql="update metadata set data=? where uuid=?"; - $this->wdb->query($sql,array($new_data,$uuid)); + $sql="update metadata set data=? where uuid='$uuid'"; + if ($this->wdb->exec($this->wdb->quoteInto($sql,$new_data))) + { $deal['uuid']=$uuid; $deal['title']=$title; $this->view->deal[]=$deal; + } } } }