當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。