From f30ac08f4f054db884cf854af7ce7f34934a9fbd Mon Sep 17 00:00:00 2001 From: wlx Date: Sun, 9 Jun 2013 04:26:41 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsql=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=8C=E4=BB=A5=E5=8F=8A=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/AuthorController.php | 10 ++++++---- application/default/views/scripts/author/apply.phtml | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 39e23cb1..dc9e4483 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -709,22 +709,24 @@ class AuthorController extends Zend_Controller_Action */ function applyAction() { - $ac = $this->_request->getParam('ac'); + $ac = $this->_request->getParam('ac'); + include_once('helper/view.php'); + $this->view->id=view::User('id'); if($ac == "mydata") { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); - include_once('helper/view.php'); $email = view::User('email'); - $realname=view::User('realname'); + $realname=view::User('realname'); + $sql = "SELECT distinct m.uuid,m.title,m.description,a.status,a.userid FROM normalmetadata m LEFT JOIN mdauthor a ON m.uuid=a.uuid LEFT JOIN role r ON r.uuid=m.uuid LEFT JOIN responsible re ON r.resid = re.id - WHERE re.email LIKE '%$email%' or re.realname='$realname'"; + WHERE r.role in ('originator','resourceProvider','pointOfContact','owner') and (re.email LIKE '%$email%' or re.individual='$realname')"; $rs = $this->db->query($sql); $this->jsonexit($rs->fetchAll()); diff --git a/application/default/views/scripts/author/apply.phtml b/application/default/views/scripts/author/apply.phtml index 09711c18..736c8500 100644 --- a/application/default/views/scripts/author/apply.phtml +++ b/application/default/views/scripts/author/apply.phtml @@ -77,8 +77,8 @@ function datareceive(data){ var result = new Array(); for(i=0;i'; + if(data[i].status==1 && data[i].userid==id; ?>) var ct='您是此元数据的作者'; + else if (data[i].status==0 && data[i].userid==id; ?>) var ct='您已经申请成为该元数据作者,请前往 我的数据 查看'; else var ct='申请成为此数据的作者'; result.push('
  • '+data[i].title+'

    '+data[i].description+'

    '+ct+'

  • '); }