diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php index 7c444ecd..cd76dbe7 100644 --- a/application/default/controllers/ReviewController.php +++ b/application/default/controllers/ReviewController.php @@ -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.='
  • -
    评审人:'.$v['realname'].'
    评审时间:'.date("Y-m-d H:i",strtotime($v['ts_created'])).'
    +
    评审人:'.$v['realname'].'
    '; + if($v['reviewid']!="") + { + $list.='[查看评审附件]  '; + } + $list .=' + 评审时间:'.date("Y-m-d H:i",strtotime($v['ts_created'])).'

    '.str_replace(array("\r\n", "\n", "\r"),'

    ',$v['mdcomment']).'

    +
  • '; @@ -357,10 +367,54 @@ class ReviewController extends Zend_Controller_Action $this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']); } } - } - - function helpAction() - { - } + } + + function helpAction() + { + } + + function attlistAction() + { + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $rid = $this->_request->getParam('id'); + + $list = array(); + $list[]= ' +
  • + 附件列表: + [关闭] +
  • + '; + + $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[] = ' +
  • '.$v['realname'].' + 下载 +
  • + '; + } + if(count($rows)>0) + { + echo ""; + }else{ + echo "无附件"; + } + + exit(); + + }// ajax 评审附件列表 + }