当前位置: 首页>>代码示例>>PHP>>正文


PHP UserRole::getGroupMemberRole方法代码示例

本文整理汇总了PHP中UserRole::getGroupMemberRole方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRole::getGroupMemberRole方法的具体用法?PHP UserRole::getGroupMemberRole怎么用?PHP UserRole::getGroupMemberRole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserRole的用法示例。


在下文中一共展示了UserRole::getGroupMemberRole方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /** 患友会首页 **/
 public function index($request, $response)
 {
     /*{{{*/
     if ($this->isSpaceLogin()) {
         //space 查看
         $this->index4Space($request, $response);
         $response->module = Space::MODULE_PATIENT4DOCTOR;
     } else {
         if (false == $this->user->isNull() && UserRole::getGroupMemberRole($this->user->id, $this->space->id)) {
             //患友查看
             $this->index4Patient($request, $response);
         } else {
             //浏览者查看
             $this->index4Browser($request, $response);
         }
     }
     $response->title = $this->space->host->hospitalfaculty->hospital->commonName . $this->space->name . '大夫患友会';
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:19,代码来源:patientcontroller.php

示例2: canShareArticle

 /** 是否可以分享 **/
 private function canShareArticle($article, $response)
 {
     /*{{{*/
     $response->canShareArticle = false == $this->user->isNull() && UserRole::getGroupMemberRole($this->user->id, $this->space->id) && false == $article->hasDocAttachment();
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:6,代码来源:articlecontroller.php

示例3: detail

	/** 文章详细(D,HF) */
    public function detail($request, $response)
    {/*{{{*/
		/** 当前空间主人的所有医生身份 */
		$doctorIds = DoctorClient::getInstance()->getDoctorList4space($this->_newSpace->user->id);
		$belongDoctors = DAL::get()->find('doctor', $doctorIds);
		$response->belongDoctors = $belongDoctors;
		foreach ($belongDoctors as $doctor) 
		{  
			$response->facultyName=$doctor->hospitalfaculty->name;
			break;
		}
		$response->newSpace=$this->_newSpace;

		$thankLetterCount = 0;
		if($this->_newSpace->isDoctor()){
			$thankLetterCount = $this->_newSpace->host->getCureThankLetterCount();
		}
		$response->thankLetterCount = $thankLetterCount;
		
        if($this->_newSpace->isDoctor())
        {
            $response->presentCnt = PresentClient::getInstance()->getCntOfPresent($this->_newSpace->id);
        }
		
		/** 文章详细 */
		$articleId = intval($request->getRequest('article_id', 0));
		$article = DAL::get()->find('article', $articleId);
        if(($this->_newUser->isNull() || $this->_newUser->id != $this->_newSpace->user->id )
            && $article->isAuditing())
        {
			$this->message('文章正在审核中!', $response, array('forward' => $this->_newSpace->getUrl() ));
            return false;
        }
		
		if ($article->user->id != $this->_newSpace->user->id)
        {
            $response->setFor404();
			$this->message('错误的链接!', $response, array('forward' => $this->_newSpace->getUrl() ));
            return false;
        }
        if ($article->isDelete()) 
        {
            $response->setFor404();
			$this->message('文章已经被删除了!', $response, array('forward' => $this->_newSpace->getUrl() ));
            return false;
		}
		$response->article = $article;

        if($article->isShield() && $this->_newSpace->user->name != $this->_newUser->name)
        {
			$this->message('您无权查看此文章', $response, array('forward' => $this->_newSpace->getUrl() ));
            return false;
        } 
		
		//患者身份
		$CanShareArticle = false;
		if($this->_newUser->isNull() == false && UserRole::getGroupMemberRole($this->_newUser->id, $this->_newSpace->id) && false == $article->hasDocAttachment())
		{
			$CanShareArticle = true;
		}
		$response->CanShareArticle=$CanShareArticle;
		
		/** 文章分类 */
		$this->_getArticleCategoryList(false, $response);
		/** 文章评论 */
		$res = ArticleClient::getInstance()->getCommentList($article->id);
        if(false == empty($res))
        {
            $response->commentList = $res['commentList'];
        }
        else
        {
            $response->commentList = array();
        }
		/** 相关文章 */
		$relatedArticleList = ArticleClient::getInstance()->getRelateArticleList($this->_newSpace->user->id, $article->id);

        if($article->isNull() == false){
		  $response->articleHits = $this->getArticleHits($article);
          $isShare = $request->getRequest('isShare', '');
          //分享文章阅读量统计
          if(false == empty($isShare))
          {
              HitClient::getInstance()->increaseArticleHitsForShare($article->id);
          }
        }
        
        //接口中取内容
        $this->getRelationInfo($article, $this->_newUser, $response);
        //在患友会里的文章贴子的最新动向
        $this->getReTopicInfo($article, $response);
        
        
		$response->relatedArticleList = $relatedArticleList;
		
		$response->articleObject = $article;
		$response->title = $article->title.'_好大夫在线';
		$articleContentArr = explode('</P>',$article->content);
        $articleContentArr = explode('</p>',$articleContentArr[0]);
//.........这里部分代码省略.........
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:101,代码来源:articlecontroller.php


注:本文中的UserRole::getGroupMemberRole方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。