public function newPost($request, $response)
 {
     /*{{{*/
     $verifyOk = Captcha::verify($request->verifyStr, XIpLocation::getIp(), 'article', $request->article_id, $request->token);
     DBC::requireTrue($verifyOk, "您输入的验证码有误!");
     //禁用词检查
     $title = $request->title;
     $result = DoctorClient::getInstance()->getProfanityCheck($title);
     DBC::requireFalse($result['CODE'] < 0, "文章 评论添加失败");
     DBC::requireFalse($result['CODE'] == 2, "文章 评论添加成功");
     $title = $result['CONTENT'];
     $content = htmlspecialchars($request->getRequest('content'), ENT_COMPAT | ENT_HTML401, 'ISO-8859-1');
     $result = DoctorClient::getInstance()->getProfanityCheck($content);
     DBC::requireFalse($result['CODE'] < 0, "文章 评论添加失败");
     DBC::requireFalse($result['CODE'] == 2, "文章 评论添加成功");
     $content = $result['CONTENT'];
     $article = DAL::get()->find('article', $request->article_id);
     $feilds = array();
     $feilds['ip'] = XIpLocation::getIp();
     $feilds['ipLocation'] = XIpLocation::getLocationArea();
     $userId = $this->user->isNull() == false ? $this->user->id : '';
     $comment = ArticleClient::getInstance()->addComment($article, $userId, $title, $content, $feilds);
     squid::clean($article->getUrl(), true);
     $this->message('您发表的评论已经提交,待网站审核通过后即可展示。', $response);
 }
Ejemplo n.º 2
0
    public function detail($request, $response)
    {/*{{{*/
		$articleId = intval($request->getRequest('article_id', 0));
		$article = DAL::get()->find('article', $articleId);
        if($article->isNull())
        {
            $this->_exit404();
        }
        DBC::requireFalse($article->isDelete(), "文章已经被删除了!");
        DBC::requireFalse($article->isShield(), "文章正在审核中!");
        if ($article->isAuditing())
        {
            $result = $this->filterArticle($article);
            if (false == empty($result['title']) || false == empty($result['content']))
            {
                DBC::requireFalse(true, "文章正在审核中!");
            }
        }
        $isShare = $request->getRequest('isShare', '');
        //分享文章阅读量统计
        if(false == empty($isShare))
        {
            HitClient::getInstance()->increaseArticleHitsForShare($article->id);
        }
        $response->article = $article;
        $response->topTitle = XString::truncate($article->title, 18);
        $response->title = $article->title."_好大夫在线";

        $articleAttachmentRef = new NullEntity();
        if ($article->hasDocAttachment())
        {
            $articleAttachmentRef = ArticleClient::getInstance()->getValidAttachmentRef($article->id);
        }
        $response->articleAttachmentRef = $articleAttachmentRef;
    }/*}}}*/
    public function updateDoctorSitemap()
    {/*{{{*/
		$curPage = $_SERVER["argv"][1]; //开始页
		echo date("Y-m-d H:i:s")." Current page: {$curPage} start... \n";
        $indexFilePath = dirname(__FILE__).'/../../wwwfront/root/sitemap/';
        $indexFileName = $curPage.'.xml';
		$indexFile = $indexFilePath.$indexFileName;
        if(false == isset($_SERVER["argv"][2])) //若只有一个医生id 
        {
            $spaces = DAL::get()->find('space',array($curPage));
        } 
        else 
        {
            $pageSize = $_SERVER["argv"][2]; //每一页大小
            $spaces = SpaceClient::getInstance()->getConfirmedSpaces($curPage,$pageSize);
        }
        if(false == count($spaces))
        {
            echo date("Y-m-d H:i:s")." {$curPage} Space NOT FOUND! Processing quit";
            exit;
        }
		$startTime = '2011-01-01'; //只统计从2011年开始的CASE和文章
        $startTime2= mktime(0,0,0,1,1,2011);
        foreach($spaces as $space)
        {
            $cases = FlowClient::getInstance()->getIdAndSpaceName4sitemap($space->id,$startTime);
			$articles = ArticleClient::getInstance()->getIdAndSpaceName4sitemap($space->id,$startTime2);
            $sourceType = ($space->isOpenFlow())?(Space::SPACE_SITEMAP_SOURCE_FLOW):(Space::SPACE_SITEMAP_SOURCE_CASE);
			$this->createSitemap($cases, $space->user->name, $sourceType, $indexFile);
			$this->createSitemap($articles, $space->user->name, Space::SPACE_SITEMAP_SOURCE_ARTICLE, $indexFile);
		}
		echo date("Y-m-d H:i:s")." {$curPage},".(isset($pageSize)?$pageSize:'')." Finshed! Process Space number:".count($spaces)."\n";
    }/*}}}*/
 private function getDoctorArticleCnt()
 {
     /*{{{*/
     $options = array();
     $options['articleLevel'] = Article::LEVEL_0;
     $articleList = ArticleClient::getInstance()->getList($this->space->id, 0, 1, 1, $options);
     return isset($articleList['pageInfo']['total']) ? $articleList['pageInfo']['total'] : 0;
 }
Ejemplo n.º 5
0
    /**
        * @brief 获取医生的文章列表 
        * @author 
        * @exampleUrl http://dev.mobile-api.haodf.com/patientapi/article_getDoctorArticleList?userId=581662815&pageId=1&pageSize=10
        *
        * @Param $doctorId 用户id
        * @Param $pageSize 每页显示数
        * @Param $nowPage 当前页码
        *
        * @Returns array('id', 'sn', 'price', 'statusDesc', 'flowId', 'spaceId', 'doctorName', 'hospitalName', 'hospitalFacultyName', 'alertMsg', 'needPay', 'caseType', 'doctorAssistant', 'doctorAssistantTel');
     */
    public function getDoctorArticleList($userId, $doctorId, $pageSize = 10, $pageId = 1)
    {/*{{{*/
        $doctor = DAL::get()->find('doctor', $doctorId);
        $user = DAL::get()->find('user', $userId);
        if($userId != $this->currentUserId)
        {
            $this->setErrorCode(309);
            return 0;
        }
		if ($user->isNull() || $user->id == 0)
		{
            $this->setErrorCode(107);
            return 0;
        }
        if($doctor->isNull())
        {
            $this->setErrorCode(132);
            return 0;
        }
    	if ($doctor->space->isNull())
        {
            $this->setErrorCode(144);
            return 0;
        }
		$res = ArticleClient::getInstance()->getList($doctor->space->id, '', $pageId, $pageSize, array('articleLevel' => Article::LEVEL_2, 'orderby' => 'topLevel desc, fld_ArticleCreateTime desc'));
        $myDoctor = DAL::get()->find_by_userIdAndDoctorId('userdoctor', $userId, $doctor->id);
        $results = array();
        $articleIds = array();
        foreach($res['articleList'] as $article)
        {
            $result = array();
            $result['id'] = $article->id;
            $result['title'] = $article->title;
            $result['doctorName'] = $article->space->host->name." ".$article->space->host->hospitalfaculty->hospital->commonName;
            $result['content'] = XString::truncate(str_replace(array("\n", "\t", "\r", "&nbsp;"), "", strip_tags(htmlspecialchars_decode($article->content))), 50); 
            $result['ctime'] = $article->ctime;
            $result['hits'] =  HitClient::getInstance()->getArticleHitsForMobile($article->id) + $article->hits;
            $result['url'] = '';
            $result['type'] = "article";
            $result['isSelfOwner'] = 0;
            $result['subscriptionId'] = $myDoctor->id;
            $result['subscriptionType'] = 'userdoctor';
            $articleIds[] = $article->id;
            $results[$article->id] = $result;
        }
        $readStatus = SubscriptionClient::getInstance()->getUserSubscriptionReadStatus($userId, $articleIds);
        foreach($readStatus as $contentId => $status)
        {
            $results[$contentId]['readStatus'] = $status;
        }
        $this->content = array_values($results); 
        $pageInfo['pages'] = $res['pageInfo']['pages'];
        $pageInfo['pagesize'] = $pageSize;
        $pageInfo['nowpage'] = $pageId;
        $pageInfo['total'] = $res['pageInfo']['total'];
        $this->pageInfo = $pageInfo;
    }/*}}}*/
 public function deletePost($request, $response)
 {
     /*{{{*/
     $isSuccess = ArticleClient::getInstance()->deleteArticleCategory($request->categoryId);
     if ($isSuccess) {
         $this->message('文章分类 ' . $request->categoryName . ' 删除成功', $response);
     } else {
         $this->message('操作失败,请稍后重试', $response);
     }
 }
	public function deletePost($request, $response) {
		$isSuccess = ArticleClient::getInstance()->deleteArticleCategory($request->category_id);
		if($isSuccess){
			$this->message('文章分类 '.$request->category_name.' 删除成功', $response, array(
				'forward' => $response->router->urlfor('adminarticlecategory/index')
			));
		}else{
			$this->message('操作失败,请稍后再试', $response, array(
				'forward' => $response->router->urlfor('adminarticlecategory/index')
			));
		}
	}
    private function buildData($hospitalFacultys, $doctors)
    {/*{{{*/
        $resArray = array();
        foreach ($hospitalFacultys as $hospitalFaculty)
        {
            $hospital = $hospitalFaculty->hospital;
            $faculty = $hospitalFaculty->faculty;
            $isPlus = PlussignChannelClient::getInstance()->isHospitalFacultyBookDoctor($hospital->name, $faculty->name);
            $keyWord = $hospital->commonName.$hospitalFaculty->name;
            if($isPlus)
            {
                $content1 = "提供".$doctors[$hospitalFaculty->id]."等".
                    $hospitalFaculty->doctorCount."位大夫的擅长、门诊时间查询,".
                    $keyWord.$hospitalFaculty->spaceCount."位大夫提供免费网上咨询,另外有"
                    .count($isPlus)."位大夫提供预约加号服务。";
                $hospitalEncode = Codec::getInstance()->encodeId($hospital->name);
                $facultyEncode = Codec::getInstance()->encodeId($faculty->name);
                $url3 = "http://www.".URL_PREFIX."haodf.com/jiahao/search.htm?district=".$isPlus[0].
                    "&hospitalName=".$hospitalEncode."&facultyName=".$facultyEncode;
            }
            else
            {
                $content1 = '提供'.$doctors[$hospitalFaculty->id].
                    '等'.$hospitalFaculty->doctorCount.'位大夫的擅长、门诊时间查询,'.
                    $keyWord.$hospitalFaculty->spaceCount.'位大夫提供免费网上咨询。';
                $hasArticle = ArticleClient::getInstance()->hasArticleInHospitalFaculty($hospitalFaculty->id);
                $url3 = '';
                if(false == empty($hasArticle))
                {
                    $url3 = $hospitalFaculty->getWenZhangUrl();
                }
                BeanFinder::get('LocalCache')->removeAll(); 
            }
            $url4 = $hospital->getReMapUrl();

            $resArray[$hospitalFaculty->id]['item'] = array(
                'keyword'=>$keyWord,
                'url'=>$hospitalFaculty->getUrl(),
                'creator'=>'haodf.com',
                'title'=>$hospital->commonName.$hospitalFaculty->name." 好大夫在线",
                'publishdate'=>date('Y-m-d', time()),
                'content1'=>$content1,
                'url1'=>$hospitalFaculty->getScheduleUrl(),
                'url2'=>$hospitalFaculty->getDoctorUrl(),
                'url3'=>$url3,
                'url4'=>$url4,
            );
            unset($hospitalFaculty);
            BeanFinder::get('LocalCache')->removeAll(); 
        }
        unset($hospitalFacultys, $doctors);
        return $resArray;
    }/*}}}*/
Ejemplo n.º 9
0
    protected function getData($nowPage,$pageSize)
    {/*{{{*/
        $articleArray = array();
        $pageInfo = array();
        $pageInfo['pageSize'] = $pageSize;
        $pageInfo['nowPage'] = $nowPage;
        $options = array();
        $options['level'] = '>=2';
	    $articleList = ArticleClient::getInstance()->getListByHospital($this->hospitalId, $options, $pageInfo); 
        foreach($articleList['articleList'] as $article) 
        {
            $articleArray[] = array('item' => $this->getRealData($article));
            unset($article);
        }
        BeanFinder::get('LocalCache')->removeAll(); 
        return $articleArray;
    }/*}}}*/
	public function newPost($request, $response){
        $verifyStr = $request->verifystr;
        $verifyOk = Captcha::verify($verifyStr, XIpLocation::getIp(), 'article', $request->article_id, $request->token);
        if($verifyOk == false)
        {
            $this->message('您输入的验证码有误!', $response);
            return false;
        }

		//禁用词检查
		$title = $request->title;
		$result = DoctorClient::getInstance()->getProfanityCheck($request->title);
		if ($result['CODE'] < 0) {
			$this->message('文章 评论添加失败', $response);
			return false;
		}
		if ($result['CODE'] == 2) {
			//提示发表成功,但是数据没有入库
			$this->message('文章 评论添加成功', $response);
			return true;
		}
		$title = $result['CONTENT'];
		
		$content = htmlspecialchars($request->getRequest('content'), ENT_COMPAT | ENT_HTML401, 'ISO-8859-1');
		$result = DoctorClient::getInstance()->getProfanityCheck($content);
		if ($result['CODE'] < 0) {
			$this->message('文章 评论添加失败', $response);
			return false;
		}
		if ($result['CODE'] == 2) {
			//提示发表成功,但是数据没有入库
			$this->message('文章 评论添加成功', $response);
			return true;
		}
		$content = $result['CONTENT'];
		
		$article = DAL::get()->find('article', $request->article_id);
		$feilds = array();
		$feilds['ip'] = XIpLocation::getIp();
		$feilds['ipLocation'] = XIpLocation::getLocationArea();
		$userId = ($this->_newUser->isNull() == false) ? $this->_newUser->id : '';
		$comment = ArticleClient::getInstance()->addComment($article, $userId, $title, $content, $feilds);
        squid::clean($article->getUrl(), true);

		$this->message('您发表的评论已经提交,待网站审核通过后即可展示。', $response);
	}
Ejemplo n.º 11
0
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $options['level'] = Article::LEVEL_2;
     $articleList = ArticleClient::getInstance()->getList($nowPage, $pageSize, $options);
     $articleRes = array();
     foreach ($articleList['articleList'] as $article)
     {
         $res = array();
         $res['name'] = $title." ".$article->space->host->hospitalfaculty->hospital->commonName.
                         $article->space->host->hospitalfaculty->name.$article->space->host->name."иб▒ь";
         $res['url'] = $article->getUrl();
         $res['date'] = date('Y-m-d', time());
         $res['content'] = $this->filterContent($article->content);
         $res = $res + $this->getRelationData($article);
         $articleRes[] = $res;
         unset($article);
     }
     return $articleRes;
 }/*}}}*/
Ejemplo n.º 12
0
	public function showReply($request, $response)
	{/*{{{*/
        $response->from = $request->from;
        $comment = DoctorCommentClient::getInstance()->getDoctorCommentSubClass($request->commentid);

        $this->skipHospitals($comment->doctor->hospitalfaculty->hospital->id, $response);
        $this->skipDoctors($comment->doctor->id, $response);

		if($comment->isNull() || strpos($request->username, 'guest') === false)
		{
			$this->_exit404();
		}
        $ref = new NullEntity();
        if($comment->doctor->hasSpace())
        {
            $ref = DAL::get()->find_by_spaceid_and_patientid_and_status('DoctorPatientRef', $comment->doctor->space->id, $comment->patientId, DoctorPatientRef::STATUS_INIT);
        }
        $response->ref = $ref;

		$response->comment = $comment;
		$doctor = $comment->doctor;
		$response->doctor = $doctor;
		$response->pageModule = "comment";
		$response->commentCount = count($comment);
		$response->newSpace = $doctor->space;
		$response->newUser = $this->curUser;
		$articleCount = 0;
   		if($doctor->hasSpace() && $doctor->space->isOpened())
   		{
			$articleCount = ArticleClient::getInstance()->getStickArticle($doctor->space->id,0,'',0);
   		}
		$response->articleCount = $articleCount;
		$response->dcPostList = DoctorCommentClient::getInstance()->getAllValidPost($comment);
		//取用户身份显示相应模块
		$huifuPostDisplay = 1;
		$dingDisplay = 1; 
		$response->huifuPostDisplay = $huifuPostDisplay;
		$response->dingDisplay = $dingDisplay;
		$response->provinceUrlTable = Area::provinceUrlTable();
		$response->dcTypeStr = array('看病经验','感谢信', '看病经验','看病经验','同行推荐');
		$postDisplay = 1;
		$dingDisplay = 1;
		$response->postDisplay = $postDisplay;
		$response->dingDisplay = $dingDisplay;
		
		//用户针对医生的扩展信息 入加号以及咨询
		$userCommentexpandInfo = $this->getUserCommentexpandInfo(array($comment), $doctor);
		$response->userCommentexpandInfo = $userCommentexpandInfo;
		$response->hostUserName = $request->username;
        $response->crumb = $this->genCrumb();
		$response->recommendPresents = PresentClient::getInstance()->getRecommendedPresents();
        $response->doctorPatientRef = DAL::get()->find_by_userid_and_spaceid('DoctorPatientRef', $this->curUser->id, $doctor->space->id);
        $response->sortResult = $this->getCommentAndPresentOrder($doctor);
	}/*}}}*/
Ejemplo n.º 13
0
 private function getArticles($request, $response)
 {
     /*{{{*/
     $options = array();
     $pageSize = 10;
     if ($this->isSpaceLogin()) {
         $options['articleLevel'] = Article::LEVEL_0;
         $pageSize = 20;
     }
     $articleList = ArticleClient::getInstance()->getList($this->space->id, 0, 1, $pageSize, $options);
     $response->articleCount = isset($articleList['pageInfo']['total']) ? $articleList['pageInfo']['total'] : 0;
     $newArticleList = isset($articleList['articleList']) ? $articleList['articleList'] : array();
     $newHitRes = array();
     if (false == empty($newArticleList)) {
         $articleIds = array_keys($newArticleList);
         foreach ($articleIds as $articleId) {
             $redisKey = "article_" . $articleId;
             $newHitRes[$articleId] = HitClient::getInstance()->getHitCntByKey($redisKey);
         }
         $topArticleList = array();
         $downArticleList = array();
         foreach ($newArticleList as $article) {
             if ($article->topLevel) {
                 $topArticleList[] = $article;
             } else {
                 $downArticleList[] = $article;
             }
         }
         XString::sortArray($topArticleList, 'topLevel');
         XString::sortArray($downArticleList, 'ctime');
         $newArticleList = array_merge($topArticleList, $downArticleList);
     }
     $response->articleList = $newArticleList;
     $response->hitRes = $newHitRes;
 }
Ejemplo n.º 14
0
                    <a target="_blank" href="<?=$space->getPatientFeedBackUrl()?>" class="g_tel">可通电话</a>
                <?php } ?>
                <?php if(true == $space->isCaseAndNewCaseOpen() && false == $space->isRefusedNewCase() && $space->user->allowAnswer() && 0 != $space->modulecase->allowNewMaxNumber){ ?>
                           <a target="_blank" href="<?=$space->getAskUrl()?>" class="g_advise1">可咨询</a>
                    <?php  } ?>
                <?php if ($space->isBookingOpened()) { ?>
							<a  target="_blank" href="http://<?=URL_PREFIX?>jiahao.haodf.com/doctor/<?=$space->userName?>/index.htm" class="g_jia">可加号</a>				
                <? } ?>
						</p>
        <? } ?>
						<p class="gray3 pt10">
                        <?php if(isset($postCount) && $postCount > 0){ ?>
                            <a target="_blank" href="http://www.<?=URL_PREFIX?><?=$space->userName?>.haodf.com/zixun/list.htm" class="look_a1">近两周回复<span class="look_num1"><?=$postCount?></span>问</a> |
                        <?php } ?>
                        <?php if (false == $space->isNull()) {
                                $articleCount = ArticleClient::getInstance()->getArticleCount('article', null, $space);
                                if (0 < $articleCount){
                        ?>
                            <a target="_blank" href="http://www.<?=URL_PREFIX?><?=$space->userName?>.haodf.com/lanmu" class="look_a1">发表文章<span class="look_num1"><?=$articleCount?></span>篇</a> |
                        <?php   }
                            } 
                        ?>
                        <?php 
                        if ($doctor2 instanceof Doctor)
                        {
                        $commentDiseaseGroup = DoctorCommentClient::getInstance()->queryCommentDiseaseGroup($doctor2->getPrimaryDoctor());
                        foreach($commentDiseaseGroup as $groupInfo)
                        {
                            if ($disease->id == $groupInfo['diseaseid'])
                            {
                                $kanbingjyCnt = $groupInfo['cnt'];
    /**
        * @brief 获取文章列表
        * @author meihao
        * @exampleUrl http://dev.mobile-api.haodf.com/doctorapi/patientclub_getArtcleList?userId=1&pageSize=1&pageId=1&os=1&xdoc=1
        *
        * @Param $userId  用户id
        * @Param $pageSize  每页条数
        * @Param $pageId  页号
        * @Param $os 
        *
        * @Returns   array('articleId', 'doctorId', 'grade', 'title', 'ctime', 'categroy', 'readCount', intro', 'url');
     */
    public function getArtcleList($userId, $pageSize, $pageId, $os)
    {/*{{{*/
        $this->_initPageInfo($pageId, $pageSize);
        $space = DAL::get()->find_by_fld_SpaceUserId('space', $userId);
    	if ($space->isNull())
        {
            $predoctor = DAL::get()->find_by_userid('predoctor', $userId);
            if(!$predoctor->isNull())
            {
                    return 0;
            }
            $this->setErrorCode(144);
            return 0;
        }
        $categoryId = null;
        $options['orderby'] = 'topLevel desc, fld_ArticleCreateTime desc';
		$res = ArticleClient::getInstance()->getList($space->id, $categoryId, $pageId, $pageSize, $options);
        $articleList = $res['articleList'];
        $pageInfo = $res['pageInfo'];
        $this->pageInfo = $pageInfo;
        $infos = array();
        $topArticleList = array();
        $bottomArticleList = array();
        foreach($articleList as $article)
        {
            if ($article->topLevel)
            {
                $topArticleList[] = $article;
            }
            else
            {
                $bottomArticleList[] = $article;
            }
        }
        XString::sortArray($topArticleList, 'topLevel');
        XString::sortArray($bottomArticleList, 'ctime');
        $articleList = array_merge_recursive($topArticleList, $bottomArticleList); 
        foreach($articleList as $article)
        {
            if (trim(strip_tags($article->content)) == '')
            {
                continue;
            }
            $info = array();
            $info['articleId'] = $article->id;
            $info['doctorId'] = $space->host->id;
            $info['grade'] = ($article->topLevel)? 3 : 0;
            $info['title'] = $article->title;
            $info['ctime'] = XDateTime::printTime4Touch($article->ctime->getTime(), 'Y-m-d');
            $info['category'] = '['.$article->articleCategory->name.']';
            $info['readCount'] = $this->getHits($article);
            //$info['intro'] = trim(mb_substr(XString::getContentWithOutHtml($article->content), 0, 90, 'gbk'));
            $info['intro'] = mb_substr(trim(preg_replace(array("/(&#[0-9]+;)/", "/(&\w+;)/"), '', str_replace(array("\r", "\n"), '', strip_tags(htmlspecialchars_decode($article->content))))), 0, 90, 'GBK');
            $info['url'] = "http://www.".URL_PREFIX."haodf.com/index/mobilearticle?id=".$info['articleId']."&clkfrom=".$os;
            $infos[] = $info;
        }
        $this->content = $infos;
    }/*}}}*/
Ejemplo n.º 16
0
    /** 初始化科室网站的主菜单 */
    private function _initHospitalFacultyMainMenu()
    {/*{{{*/
        $mainMenu = array();
        $mainMenu['Index'] = $this->_allMainMenu['Index'];

        if ($this->_newSpace->isArticleOpened()) {
            /** 取文章分类作为菜单 */
        	$articleCategoryList = ArticleClient::getInstance()->getCategoryList($this->_newSpace->user->id);

            /** 根据字数来大概确定菜单的长度 */
            $nameCount = 0;
            foreach($articleCategoryList as $category){
                if ($nameCount > 40) { break; }
                $mainMenu['ArticleCategory_'.$category->id] = array('Name' => $category->name, 'Controller' => 'article', 'Action' => 'index', 'Param' => array('category_id' => $category->id));
                $nameCount += strlen($category->name);
            }
        }
        if ($this->_newSpace->isRelatedArticleOpened()) {
            $mainMenu['Doctor_Article'] = array('Name' => '医生文章', 'Controller' => 'article', 'Action' => 'doctorarticlelist');
        }

        if ($this->_newSpace->isCaseAndNewCaseOpen()) {
            $mainMenu['Case'] =  $this->_allMainMenu['Case'];
            $mainMenu['Case']['Name'] = '患者咨询';
        }
        if ($this->_newSpace->isScheduleOpened()) {
            $mainMenu['Schedule'] = $this->_allMainMenu['Schedule'];
        }
        if ($this->_newSpace->isPhotoOpened()) {
            $mainMenu['Photo'] = $this->_allMainMenu['Photo'];
        }
        
        if ($this->_spaceIsLogin) {
             $mainMenu['Setup'] =  $this->_allMainMenu['Setup'];
        }
        return $mainMenu;
    }/*}}}*/
Ejemplo n.º 17
0
    public function healthNews($request, $response)
    {/*{{{*/
        $page = $request->page?$request->page:1;
        $pageSize = 50;
        $articleIds = array();
        $zhuantiIds = array();
        $articleDiseases = array();
        $zhuantis = array('list' => array());
        $articles = ArticleClient::getInstance()->getArticleList4Baidu($page,$pageSize);
        $this->sortHealthNewsArray($articles['list'], 'ctime');
        $firstArticle = array_shift($articles['list']);
        $lastArticle = array_pop($articles['list']);
        array_push($articles['list'], $lastArticle);
        array_unshift($articles['list'], $firstArticle);
        $articles['list'] = array_filter($articles['list']);
//        if ($firstArticle && $lastArticle) 
        {
//            $zhuantis = ZhuanTiClient::getInstance()->getZhuanTiList4Baidu($lastArticle->ctime, $firstArticle->ctime);
        }   
        foreach ($articles['list'] as $article)
        {
            $articleIds[] = $article->id;
        }
        if (false == empty($articleIds))
        {
            $articleDiseases = DiseaseClient::getInstance()->getDiseaseLablesByObjIds($articleIds, 'article', $pageSize);	
        }


        if($page == 1)
        {
            $papers = array('list'=>array());
            $papers['list'] = PaperClient::getInstance()->queryOnlinePaperList(XDateTime::now()->addDay(-10));

            $thesiss = array('list'=>array());
            $thesiss['list'] = ThesisClient::getInstance()->queryThesisOnlineList(XDateTime::now()->addDay(-10)); 
            $news = $articles['list'] + $zhuantis['list'] + $papers['list'] + $thesiss['list'];
        }
        else
        {
            $news = $articles['list'] + $zhuantis['list'];
        }
        $this->sortHealthNewsArray($news, 'ctime');
        $pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("?page="), $articles['pageInfo']['nowpage'], $pageSize, $articles['pageInfo']['total']);
        $response->news = $news;
        $response->articleDiseases = $articleDiseases;
        $response->pagelink = $pagelink;
    }/*}}}*/
Ejemplo n.º 18
0
 public function loadMoreArticle($request, $response)
 {/*{{{*/
     $this->initialize($request, $response);
     $nowPage = $request->getRequest('p', 1);
     $pageSize = self::PAGESIZE_ARTICLE;
     $articleCnt = 0;
     $articleList = array();
     $options = array();
     $options['articleLevel'] = Article::LEVEL_0;
     $res = ArticleClient::getInstance()->getList($this->space->id, 0, $nowPage, $pageSize, $options);
     $articleList = $res['articleList'];
     if (false == empty($articleList))
     {
         $articleCnt = isset($res['pageInfo']['total']) ? $res['pageInfo']['total'] : 0;
         $response->nowPage = $nowPage;
         $response->pages= ceil($res['pageInfo']['total']/$pageSize);
         $response->loadUrl = $response->touchUrl.'/doctor/loadmorearticle?id='.$request->id.'&p=';
     }
     $response->articleList = $articleList;
     $response->articleCnt = $articleCnt;
 }/*}}}*/
Ejemplo n.º 19
0
    public function getDoctorByDoctorId($doctorId)
    {/*{{{*/
        $doctor = DAL::get()->find('doctor', $doctorId);
        if($doctor->isNull())
        {
            $this->setErrorCode(132);
            return 0;
        }
        $doctorInfo = array();
        $doctorInfo = $this->_getDoctorNormalInfo($doctor);
        $doctorInfo['hospitalFacultyFullName'] =$doctor->hospitalfaculty->hospital->commonName.$doctor->hospitalfaculty->name;
        $doctorInfo['hospitalFacultyId'] =$doctor->hospitalfaculty->id;
        $doctorInfo['logoUrl'] = $doctor->getHeadImageForMobile();
        $doctorInfo['homePageUrl'] = '';
        $doctorInfo['caseIntro'] = false;
        $doctorInfo['phoneIntro'] = false;
        $doctorInfo['bookingIntro'] = false;
        $doctorInfo['isSpaceOpened'] = 0;
        if($doctor->hasSpace())
        {
            $categoryId = null;
            $options['orderby'] = 'fld_ArticleStickLevel desc,fld_ArticleId desc';
            $articleRes = ArticleClient::getInstance()->getList($doctor->space->id, $categoryId, 1, 10, $options);
            $doctorInfo['articleCount'] = $articleRes['pageInfo']['total'];
            $doctorInfo['isSpaceOpened'] = 1;
            if($doctor->space->homepageOpened)
                $doctorInfo['homePageUrl'] = $doctor->space->url;
            if($doctor->space->isCaseOpen())
            {
                $doctorInfo['caseIntro'] = $doctor->space->commonCaseNote;
                $doctorInfo['newCaseIntro'] = $doctor->space->commonCaseNote == ''?$doctor->specialize:$doctorInfo['caseIntro'];
            }
            
           // if($doctor->space->isPhoneOpened()) 新的判断是否开通电话咨询规则
            if($doctor->space->isPhoneOpenedForFront())
            {
                $satisfactionLists = PaymentClient::getInstance()->getDoctorSatisfactionList($doctor->primaryId);
                //服务费
                $serviceCharge = PaymentClient::getInstance()->getServiceChargeList($doctor->space->id);
                $serviceChargeList = explode('、', $serviceCharge);
                $str = '';
                foreach($serviceChargeList as $key => $serviceCharge)
                {
                    $str .= $serviceCharge."\n";
                }
                $doctorSatisfaction = $satisfactionLists[$doctor->space->host->id];
                $satisfaction = $doctorSatisfaction['scorecnt'] != 0?(round($doctorSatisfaction['goodscore']/$doctorSatisfaction['scorecnt'],2))*100:0;
                if($doctorSatisfaction['cnt'] != '' && $doctorSatisfaction['cnt'] != 0)
                {
                    $str .= "已成功接听".$doctorSatisfaction['cnt']."例,满意度".$satisfaction."%";
                }
                $doctorInfo['phoneIntro'] = $str;
            }
            $spaceBusinessRequirement = $doctor->space->getSpaceBusinessRequirement4Booking();
            if(false == $spaceBusinessRequirement->isNull())
            {
                $doctorInfo['bookingIntro'] = $spaceBusinessRequirement->disease;
            }
            if($doctor->space->isBookingOpened())
            {
                $doctorInfo['isBookingOpened'] = 1;
            }else{
                $doctorInfo['isBookingOpened'] = 0;
            }
            if($doctor->space->isCaseAndNewCaseOpen())
            {
                $doctorInfo['isCaseOpened'] = 1;
            }else{
                $doctorInfo['isCaseOpened'] = 0;
            }
           // if($doctor->space->isPhoneOpened())
            if($doctor->space->isPhoneOpenedForFront())
            {
                $doctorInfo['isPhoneOpened'] = 1;
            }else{
                $doctorInfo['isPhoneOpened'] = 0;
            }
        }
        $doctorInfo['canVote'] = 1;
        $doctorInfo['canComment'] = 1;
        $doctorInfo['isStrictComment'] = 1;
        if($doctor->commentDoctor->trustIndex == 100)
        {
            $doctorInfo['isStrictComment'] = 0;
        }
        if(false == $doctor->canVote())
        {
            $doctorInfo['canVote'] = 0;
        }
        if(false == $doctor->canReceiveComment())
        {
            $doctorInfo['canVote'] = 0;
            $doctorInfo['canComment'] = 0;
            $doctorInfo['isStrictComment'] = 1;
        }

        //点评规则改进(信用值小于98的全部需要填写用户姓名和电话)
        $doctorInfo['needUserInfo'] = 1;
        //点评规则改进(医生信用值100 并且得票小于10的 投票时不能选择不满意和一般) todo新规则 手机上投票直接去掉不满意和一般
        $doctorInfo['voteNotSatisfied'] = 1;
        if($doctor->commentDoctor->voteCount < 10 && $doctor->commentDoctor->trustIndex == 100)
        {
            $doctorInfo['voteNotSatisfied'] = 0;
        }

        $doctorInfo['hospitalId'] = $doctor->hospitalfaculty->hospital->id;
        $doctorInfo['hospitalName'] = $doctor->hospitalfaculty->hospital->name;
        $doctorInfo['province'] = $doctor->hospitalfaculty->hospital->province;
        $doctorInfo['intro'] = Seolink::rip($doctor->intro);
        //数据迁移
        $diseaseDoctorInfos = $this->getDiseaseVoteListByDoctor($doctor);
        if(false == empty($diseaseDoctorInfos))
        {
            $doctorInfo['diseaseVotes'] = $diseaseDoctorInfos;
        }
        //数据迁移 第一条看病经验
        $commentIds = $this->getDoctorCommentListByDoctorId($doctor->primaryId, 1, 1);
        $doctorInfo['doctorCommentCnt'] = $doctor->getCureExpAndCureThankLetterCount(); 
        if(false == empty($commentIds))
        {
            $firstcommentId = $commentIds[0]['id'];
            $doctorCommentInfos = $this->getDoctorCommentByDoctorCommentId($firstcommentId);
            $doctorInfo['commentInfos'] = $doctorCommentInfos;
        }
        else
        {
            $doctorInfo['commentInfos'] = array('patient'=>'', 'tag'=>'', 'time'=>'', 'effect'=>'', 'attitude'=>'', 'content'=>'', 'type'=>'');
        }
        $this->content = $doctorInfo;
    }/*}}}*/
Ejemplo n.º 20
0
 public function deleteArticle($id)
 {/*{{{*/
     $article = DAL::get()->find('article', $id);
     ArticleClient::getInstance()->deleteArticle($id);
 }/*}}}*/
Ejemplo n.º 21
0
 public function updateCommentById($request, $response)
 {
     /*{{{*/
     $response->result = ArticleClient::getInstance()->modifyArticleComment($request->ids, array('isConfirmed' => 1));
     $response->actionDesc = "更新或设置";
     $response->id = implode(' ', $request->ids);
     $response->_my_template = '/default/processmsg';
 }
	private function getArticleList($spaceIds, $p, $size)
	{
		$articleList = array();
		$pageLink = '';
		if(empty($spaceIds) == false)
		{
			$res = ArticleClient::getInstance()->getListBySpaceIds($spaceIds, $p, $size, array('level'=>'>1'));
			$articleList = $res['articleList'];
			$pageLink = '';
			if(empty($res['pageInfo']) == false) {
				$pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate("/faculty/".$this->hospitalFaculty->getEncodeId()."/wenzhang.htm?p="),
				$res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
			}
		}
		return array($articleList,$pageLink);
	}
Ejemplo n.º 23
0
	public function faculty($request, $response) {
		$tmpHospitalFacultyList = HospitalClient::getInstance()->getAllFacultyList($this->_hospital->id);
		$array = array();
		$parentFaculty = array(); //非虚父科室
		$parentFacultyName = array(); //医院科室名
		foreach ($tmpHospitalFacultyList as $item) {
            if (false == is_string($item->faculty->parentName))
                continue;
			$array[$item->faculty->parentName][] = $item;			
			if ($item->faculty->parentId == $item->faculty->id )
				$parentFacultyName[$item->faculty->parentName] = $item->name;
				if (!$item->faculty->isVirtual)
					$parentFaculty[$item->faculty->name] = $item;
					
		}
		
		$response->hospitalFacultyList = $array;
		$response->parentFaculty = $parentFaculty;
		$response->parentFacultyName = $parentFacultyName;
		unset($array);
		unset($tmpHospitalFacultyList);
		//在线医生
//		$response->doctorList = SpaceClient::getInstance()->getCaseOpenedSpace4Hospital($this->_hospital->id, 10);
		$params = array();
		$params['hospitalId'] = $this->_hospital->id;
		$params['limit'] = 10;
		$params['postcount'] = 0;
		$params['spaceAdminLevel'] = 3;
		$doctorList = SpaceClient::getInstance()->getCaseOpenedSpaceList($params);	
		$doctorList = $doctorList['spaceList'];
		$response->doctorList = $doctorList; 
		//两周内回复数
		$spacePostCntInfos = $this->getspacePostCntInfo($doctorList);
	    $response->spacePostCntInfos = $spacePostCntInfos;	 
		
		if ($response->doctorList)
			$response->doctorUserNotice = '';
		else
			$response->doctorUserNotice = $this->_hospital->commonName." 目前没有医生提供咨询服务,您可以咨询同专业其他大夫:";
		//最新文章
		$tmpArticle = ArticleClient::getInstance()->getListByHospital($this->_hospital->id, 
			array('level' => '>=2', 'type' => '=0'), array('limit' => self::SIDE_ARTICLE_NUM));		
		$response->articleList = $tmpArticle['articleList'];
		
		
		$response->keywords = $this->_hospital->commonName."科室,".$this->_hospital->commonName."在线咨询,"
			.$this->_hospital->commonName."专家";
		$response->description = $this->_hospital->commonName.$this->_hospital->facultyCount.'个科室、'
			.$this->_hospital->doctorCount.'位医生的详细门诊时间、出停诊时间安排及医生的擅长介绍';
		if ($this->_hospital->isDailyUpdate())
			$response->description .= '。专家门诊时间于'.$this->_hospital->hospitalAnnounce->utime->toStringByFormat('m月d日更新').'...';
		$response->title = $this->_hospital->commonName.'科室列表_好大夫在线';
		$response->pageModule = 'schedule';
	}
 public function listOfArticleClickRank($request, $response)
 {
     /*{{{*/
     $nowPage = (int) $request->getRequest('p', 1);
     $pageSize = (int) $request->getRequest('pageSize', 20);
     $keyWord = $request->keyWord;
     $beginTime = $request->beginTime;
     $endTime = $request->endTime;
     $type = $request->type;
     $res = ArticleClient::getInstance()->getArticleByHits4Search($beginTime, $endTime, $keyWord, $pageSize, $nowPage);
     $pageLink = '';
     if (empty($res['pageInfo']) == false) {
         $url = "/articlemodel/listofarticleclickrank?pageSize=" . urlencode($pageSize) . "&keyWord=" . urlencode($keyWord) . "&beginTime=" . urlencode($beginTime) . "&endTime=" . urlencode($endTime);
         $pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate($url . "&p="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
     }
     array_pop($res);
     $response->arr = $res;
     $response->type = $type;
     $response->nowPage = $nowPage;
     $response->pageSize = $pageSize;
     $response->pageLink = $pageLink;
     $response->beginTime = $beginTime;
     $response->endTime = $endTime;
     $response->keyWord = $keyWord;
 }
 public function setDownOneStep($request, $response)
 {
     /*{{{*/
     $articleId = $request->articleId;
     $res = ArticleClient::getInstance()->setArticleDownOneStep($articleId);
     $response->setRedirect($this->space->getUrl() . 'lanmu?articleId=' . $articleId);
 }
Ejemplo n.º 26
0
	public function showDetail($request, $response)
	{/*{{{*/
		$id = $request->id;
		$id = (int)Codec::getInstance()->decodeId($id);
		if(empty($id))
		{
            throw new BizException('医生信息不存在.');
			exit();
		}
		$doctor = DAL::get()->find('doctor', $id);
		if($doctor == null || $doctor->isNull() || $doctor->hospitalfaculty instanceof NullEntity)
		{
            throw new BizException('医生信息不存在.');
			exit();	
		}

        $this->skipHospitals($doctor->hospitalfaculty->hospital->id, $response);
        $this->skipDoctors($doctor->id, $response);
   		$response->doctor = $doctor;
        $scheduleTable = array();
        $scheduleTables1 = DoctorClient::getInstance()->getFormatScheduleList($doctor->id);
   		if($doctor->id != $doctor->primaryId)
   		{
        	$scheduleTables = DoctorClient::getInstance()->getFormatScheduleList($doctor->primaryId);
	        $tmpInfos1 = $scheduleTables1[$doctor->id];
	        $tmpInfos2 = $scheduleTables[$doctor->primaryId];
	        foreach($tmpInfos1 as $i=>$infos)
	        {
                if(empty($infos) || false==is_array($infos))
	        		continue;
	        	$items = array();
	        	foreach($infos as $j=>$info)
	        	{
	        		$items[$j] = (false == empty($tmpInfos1[$i][$j])) ? $tmpInfos1[$i][$j] : ""; 
	        	}
	        	$scheduleTable[$i] = $items;
	        }
   		}
   		else
   		{
   			$scheduleTable = $scheduleTables1[$doctor->id];
   		}
        $options['doctor'] = $doctor->primaryId;
        $pageInfo['pageSize'] = 10;
		$commentList = DoctorCommentClient::getInstance()->getCommentList($options, $pageInfo);
		$commentList = $commentList['commentList'];
		$diseaseAry = DiseaseClient::getInstance()->getDiseaseDoctorList(array($doctor->primaryId), 50);
		$diseaseIds = array();
		foreach ($diseaseAry as $diseaseDorctor)
		{
			$diseaseIds[$diseaseDorctor->fld_diseaseid]['id'] = $diseaseDorctor->fld_diseaseid;
			$diseaseIds[$diseaseDorctor->fld_diseaseid]['name'] = $diseaseDorctor->disease->name;
			$diseaseIds[$diseaseDorctor->fld_diseaseid]['key'] = $diseaseDorctor->disease->key;
		}
		$sameDiseaseDoctorList = array();
		if(empty($diseaseIds) == false)
		{
			$sameDiseaseDoctorList = DoctorClient::getInstance()->getSameProfessionalDoctors($doctor->primaryId, array_keys($diseaseIds), $limit=4);	
		}
		
		$articleList = array();
		$spaceCaseList = array();
		if($doctor->hasSpace() && $doctor->space->isOpened())
		{
            $articleList = ArticleClient::getInstance()->getTitleListBySpace($doctor->space->id, 3);
			$spaceCaseList = DAL::get()->find_all_lastpost_by_space('doctorpatientref', $doctor->space, 10);
		}
		$response->articleList = $articleList;
		$response->spaceCaseList = $spaceCaseList;
		
		$response->hospitalfaculty = $doctor->hospitalfaculty;
        $response->hospital = $doctor->hospitalfaculty->hospital;
        $response->faculty = $doctor->hospitalfaculty->faculty;
		
		$response->scheduleTable = $scheduleTable ; 
		$response->commentList = $commentList ;
		
		$response->diseaseAry = $diseaseAry;
		$response->diseaseIds = $diseaseIds;
		$response->VOTE_DISPLAY_LIMIT = 4;
		$response->sameDiseaseDoctorList = $sameDiseaseDoctorList;

        if($doctor->space->isNull())
        {
            $spaceAskedThreadsCount = $spaceAskedFlowsCount = $spaceRepliedThreadsCount = $spaceRepliedFlowsCount; 
        }
        else
        {
            $spaceAskedThreadsCount = SpaceClient::getInstance()->getCountOfAskedThreadsCount($doctor->space->id, $this->_newUser->id); 
            $spaceAskedFlowsCount = SpaceClient::getInstance()->getCountOfAskedFlowsCount($doctor->space->id, $this->_newUser->id);
            $spaceRepliedThreadsCount = SpaceClient::getInstance()->getCountOfRepliedThreadsCount($doctor->space->id, $this->_newUser->id);
            $spaceRepliedFlowsCount = SpaceClient::getInstance()->getCountOfRepliedFlowsCount($doctor->space->id, $this->_newUser->id);
        }

        $response->spaceAskedCount = $spaceAskedThreadsCount + $spaceAskedFlowsCount;
        $response->spaceRepliedCount = $spaceRepliedThreadsCount + $spaceRepliedFlowsCount;

        $response->crumb = Crumb::create(DoctorCommentClient::getInstance()->genCommentCrumbKey(), self::TTL);
        $space = $doctor->space;
        $response->space = $space;
        $commonCaseNote = $doctor->getCommonCaseNote4Display();
        $response->commonCaseNote = $commonCaseNote;
        $response->successOrderCount = count(DAL::get()->find_id_finishStatus_and_maybeSuccessCallBackStatus('BookingOrder', $space));
        $bookingCondition = $space->getSpaceBusinessRequirement4Booking()->disease;
        $response->bookingCondition = empty($bookingCondition) ? '不限' : $bookingCondition;
        $response->token = Captcha::generate('comment', $doctor->id, ContentFactory::TYPE_ARITHMATIC, 4, XIpLocation::getIp(), 3);
	}/*}}}*/
 <?php
     foreach($articleList as $article)
     {
         if ($article->space->host instanceof Doctor)
         {
             $space = $article->space;
             $count = (int)(HitClient::getInstance()->getHitCntByKey("article_".$article->id) + $article->hits);
             ?>
     <li>
     <a target="_blank" href="<?=$article->getUrl()?>" class="cur_t"><?=XString::truncate($article->title, 36)?></a>
         <div class="h_classics dn">
         <p class="pb10 h_t"><a target="_blank" href="<?=$article->getUrl()?>"><?=XString::truncate($article->title, 36)?></a></p>
             <p class="pb15">
                 <a target="_blank" href="<?=$article->getUrl()?>" class="g_read gray3">阅读<?=$count?></a>
             <?php 
                 $commentCount = ArticleClient::getInstance()->getCommentCount($article->id);
                 if (0 < $commentCount)
                 {
             ?>
                 <a class="g_comment gray3" target="_blank" href="<?=$article->getUrl()?>">评论<?=$commentCount?></a>
             <?php
                 }
             ?>
             </p>
             <div class="clearfix lh160">
             <p class="doc_head2 fl pr15"><a target="_blank" href="<?=$space->getUrl()?>"><img src="<?=$space->host->getSmallHeadImage()?>"></a></p>
                 <div class="oh zoom">
                 <p>发布医生: <a target="_blank" href="<?=$space->host->getUrl()?>" class="blue_a3"><?=$space->host->name?></a></p>
                 <p><?=$space->host->hospitalfaculty->hospital->commonName?></p>
                 <p><?=$space->host->hospitalfaculty->name." ".((string)$space->host->grade ? $space->host->grade : '')?></p>
                 </div>
 public function doctorMarkInfo($request, $response)
 {
     /*{{{*/
     $doctorId = $request->doctorId;
     $doctor = DAL::get()->find('Doctor', $doctorId);
     $doctorMark = DAL::get()->find_by_doctorid('DoctorMark', $doctorId);
     if ($doctorMark->isNull()) {
         $doctorMarkId = DoctorMarkClient::getInstance()->createDoctorMark($this->curInspector, $doctor);
         $doctorMark = DAL::get()->find('DoctorMark', $doctorMarkId);
     }
     $response->doctorMark = $doctorMark;
     $space = $doctorMark->space;
     //该医生开通了space,医生标签类需要绑定space
     if ($space->isNull()) {
         $space = DAL::get()->find_by_hostid_and_hosttype('Space', $doctorId, 'Doctor');
         if (false == $space->isNull()) {
             DoctorMarkClient::getInstance()->bindDoctorMarkSpace($doctor, $space->id);
         }
     }
     //获取电话咨询标签
     if (false == $space->isNull() && $space->isPhoneOpenedForFront()) {
         $spaceMark = DAL::get()->find_by_spaceid('SpaceMark', $space->id);
         if ($spaceMark->isNull()) {
             $spaceMarkId = DoctorMarkClient::getInstance()->createSpaceMark($this->curInspector, $space);
             $spaceMark = DAL::get()->find('SpaceMark', $spaceMarkId);
         }
         $response->spaceMark = $spaceMark;
     }
     //space的一些统计信息
     $response->docLastOnlineTime = $space->getLastOnlineTimeStr();
     $response->openSpaceTime = $space->isNull() ? '' : date("Y-m-d H:i", $space->ctime->getTime());
     //网上咨询
     $flowCnt = 0;
     $telOrderCnt = 0;
     $bookingOrderCnt = 0;
     $articleCnt = '';
     $myProposalThreads = DAL::get()->find_all_spaceNotProcessList('Proposal', $space, ServiceDef::TYPE_FLOW, array('patientIds' => array_keys($space->user->patientList)));
     $flowInfos = FlowClient::getInstance()->getSpaceReplyCountBySpaceIds(array($space->id));
     $flowInfo = array_shift($flowInfos);
     $flowCnt = empty($flowInfo['cnt']) ? 0 : $flowInfo['cnt'];
     $options['status'] = array(TelOrder::STATUS_FINISHED, TelOrder::STATUS_CLOSED);
     $telOrderCnt = TelOrderClient::getInstance()->getOrderCount4Space($space->id, $options);
     $bookingOrderInfo = PlussignChannelClient::getInstance()->getOrderCntOfSpaces(array($space->id));
     $bookingOrderCnt = $bookingOrderInfo[$space->id];
     if (false == $space->isNull()) {
         $articleList = ArticleClient::getInstance()->getList($space->id, 0, 1, 10, array());
         $articleCnt = isset($articleList['pageInfo']['total']) ? $articleList['pageInfo']['total'] : 0;
     }
     $response->flowCnt = $flowCnt;
     $response->telOrderCnt = $telOrderCnt;
     $response->bookingOrderCnt = $bookingOrderCnt;
     $response->articleCnt = $articleCnt;
     $response->showContent = 1;
     //判断是否为MSD医生
     $space = DAL::get()->find("space", $doctorMark->spaceId);
     $groups = DAL::get()->find_all_by_spaceid('ReGroup', $doctorMark->spaceId);
     $ary = array();
     foreach ($groups as $group) {
         $ary[$group->name] = $group->name;
     }
     $response->isHaveGroup = isset($ary[SpaceSymbol::ACTIVITY_GROUP_NAME]);
     $spaceMarkAmount = FlowMarkClient::getInstance()->getSpaceAmount(SpaceSymbol::TYPE_MSD);
     $isMsd = FlowMarkClient::getInstance()->isMarkForSpace($space, SpaceSymbol::TYPE_MSD);
     $response->isMsd = $isMsd;
     $response->spaceMarkAmount = $spaceMarkAmount;
 }
Ejemplo n.º 29
0
 public function insertArticle($spaceId, $pageId = 1, $pageSize = 20)
  {/*{{{*/
     $this->_initPageInfo($pageId, $pageSize);
     $space = DAL::get()->find('space', $spaceId);
     $res = ArticleClient::getInstance()->getList($spaceId, '', $pageId, 20, array());
     $infos = array();
     foreach($res['articleList'] as $article)
     {
         $info['title'] = $article->title; 
         $info['categoryName'] = $article->articleCategory->name;
         $info['contentWithOutTag'] = '建议:点击此处参考我的文章 《'.$article->title.'》' ;
         $info['targetUrl']  = '<a href="http://www.'.URL_PREFIX.'haodf.com/zhuanjiaguandian/'.$space->user->name.'_'.$article->id.'.htm' ;//这个标签都没闭合,有用么?
         $info['contentWithTag'] = $article->quickReplyTemplate();
         $info['id'] = $article->id;
         $info['url'] = $article->getUrl();
         $infos[] = $info; 
     }
     $this->content = $infos;
     return $infos;
  } /*}}}*/
Ejemplo n.º 30
0
echo $openService;
?>
</span></td>
    </tr>
    <tr class="h30">
        <td class="w150">目前电话咨询服务</td>
        <td><span class="fl pl10"><?php 
echo $task->source->space->getPhoneServiceChargeList();
?>
</span></td>
    </tr>
    <tr class="h30">
        <td class="w150">文章</td>
<?php 
if (false == $task->source->space->isNull()) {
    $articleList = ArticleClient::getInstance()->getList($task->source->space->id, 0, 1, 10, array());
    $articleCount = isset($articleList['pageInfo']['total']) ? $articleList['pageInfo']['total'] : 0;
} else {
    $articleCount = '';
}
?>
        <td><span class="fl pl10"><?php 
echo $articleCount;
?>
</span></td>
    </tr>
<?php 
if (false == isset($readOnly)) {
    ?>
    <tr class="h30">
        <td class="w150">操作</td>