增加了ajax读取评审附件列表的功能,修改了读取评审列表的sql语句
This commit is contained in:
parent
3f91e29aa3
commit
23983daca6
|
@ -151,9 +151,12 @@ class ReviewController extends Zend_Controller_Action
|
|||
|
||||
$uuid = $this->_request->getParam('uuid');
|
||||
|
||||
$sql = "select r.uuid,r.userid,r.ts_created,u.realname,r.mdcomment,r.conclusion from mdreview r
|
||||
$sql = "select r.id,r.uuid,r.userid,r.ts_created,u.realname,r.mdcomment,r.conclusion,ratt.reviewid from mdreview r
|
||||
left join users u on u.id=r.userid
|
||||
where r.uuid='$uuid' and r.status>-1";
|
||||
right join mdreviewattach ratt on r.id=ratt.reviewid
|
||||
where r.uuid='$uuid' and r.status>-1
|
||||
group by r.id,r.uuid,r.userid,r.ts_created,u.realname,r.mdcomment,r.conclusion,ratt.reviewid
|
||||
";
|
||||
|
||||
$rs = $this->db->query($sql);
|
||||
$rows = $rs->fetchAll();
|
||||
|
@ -170,8 +173,15 @@ class ReviewController extends Zend_Controller_Action
|
|||
$list.='
|
||||
<li>
|
||||
<div class="reviewitem">
|
||||
<div class="itemtitle">评审人:'.$v['realname'].'</div><div class="itemtime">评审时间:'.date("Y-m-d H:i",strtotime($v['ts_created'])).'</div>
|
||||
<div class="itemtitle">评审人:'.$v['realname'].'</div><div class="itemtime">';
|
||||
if($v['reviewid']!="")
|
||||
{
|
||||
$list.='[<a href="javascript:;" onclick="checkfiles(\''.$v['id'].'\')">查看评审附件</a>] ';
|
||||
}
|
||||
$list .='
|
||||
评审时间:'.date("Y-m-d H:i",strtotime($v['ts_created'])).'</div>
|
||||
<div class="itemcontent"><p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$v['mdcomment']).'</p></div>
|
||||
<div id="filelist_'.$v['id'].'" class="filelist"></div>
|
||||
</div>
|
||||
</li>
|
||||
';
|
||||
|
@ -362,5 +372,49 @@ class ReviewController extends Zend_Controller_Action
|
|||
function helpAction()
|
||||
{
|
||||
}
|
||||
|
||||
function attlistAction()
|
||||
{
|
||||
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$rid = $this->_request->getParam('id');
|
||||
|
||||
$list = array();
|
||||
$list[]= '
|
||||
<li style="border:none">
|
||||
附件列表:
|
||||
<span><a href="javascript:void(0);" onclick="$(\'#filelist_'.$rid.' ul\').remove();">[关闭]</a></span>
|
||||
</li>
|
||||
';
|
||||
|
||||
$sql = "select att.realname,att.id from attachments att
|
||||
left join mdreviewattach ratt on ratt.attachid = att.id
|
||||
where ratt.reviewid = $rid";
|
||||
|
||||
$rs = $this->db->query($sql);
|
||||
|
||||
$rows = $rs->fetchAll();
|
||||
|
||||
foreach($rows as $k=>$v)
|
||||
{
|
||||
$list[] = '
|
||||
<li>'.$v['realname'].'
|
||||
<span><a href="/review/downatt/id/'.$v['id'].'">下载</a></span>
|
||||
</li>
|
||||
';
|
||||
}
|
||||
if(count($rows)>0)
|
||||
{
|
||||
echo "<ul>".join('',$list)."</ul>";
|
||||
}else{
|
||||
echo "无附件";
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
}// ajax 评审附件列表
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue