转换数据大小为MB单位

This commit is contained in:
wlx 2010-07-04 08:54:29 +00:00
parent a8d5f9dbc4
commit bbdb44aa63
1 changed files with 6 additions and 1 deletions

View File

@ -175,7 +175,12 @@ class Admin_WatermdController extends Zend_Controller_Action
$sql="select sum(file_size) as fsize from westdc_fileinfo where meta_uuid = ?"; $sql="select sum(file_size) as fsize from westdc_fileinfo where meta_uuid = ?";
$this->db->setFetchMode(Zend_Db::FETCH_OBJ); $this->db->setFetchMode(Zend_Db::FETCH_OBJ);
$row=$this->db->fetchRow($sql,array($uuid)); $row=$this->db->fetchRow($sql,array($uuid));
$transize_path->item(0)->nodeValue=$row->fsize; //转换单位为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)); $new_data = $dom->saveXML($root->item(0));
//防止错误 //防止错误
if (!empty($new_data)) if (!empty($new_data))