在review中增加了文件大小的读取,方便用户选择下载
This commit is contained in:
parent
bd6877fab3
commit
25d7c7c499
|
@ -389,7 +389,7 @@ class ReviewController extends Zend_Controller_Action
|
||||||
</li>
|
</li>
|
||||||
';
|
';
|
||||||
|
|
||||||
$sql = "select att.realname,att.id from attachments att
|
$sql = "select att.realname,att.id,att.filesize from attachments att
|
||||||
left join mdreviewattach ratt on ratt.attachid = att.id
|
left join mdreviewattach ratt on ratt.attachid = att.id
|
||||||
where ratt.reviewid = $rid";
|
where ratt.reviewid = $rid";
|
||||||
|
|
||||||
|
@ -399,8 +399,16 @@ class ReviewController extends Zend_Controller_Action
|
||||||
|
|
||||||
foreach($rows as $k=>$v)
|
foreach($rows as $k=>$v)
|
||||||
{
|
{
|
||||||
|
if($v['filesize'] > 1024*1024)
|
||||||
|
{
|
||||||
|
$v['filesize'] = round($v['filesize']/1024/1024,2) . "MB";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$v['filesize'] = round($v['filesize']/1024,2) . "KB";
|
||||||
|
}
|
||||||
$list[] = '
|
$list[] = '
|
||||||
<li>'.$v['realname'].'
|
<li>'.$v['realname'].' ('.$v['filesize'].')
|
||||||
<span><a href="/review/downatt/id/'.$v['id'].'">下载</a></span>
|
<span><a href="/review/downatt/id/'.$v['id'].'">下载</a></span>
|
||||||
</li>
|
</li>
|
||||||
';
|
';
|
||||||
|
|
Loading…
Reference in New Issue