Пример #1
0
    public function index($request,$response)
    {/*{{{*/
        /* bigpipe用来做切换,true表示关闭,以普通模式浏览 */
        $response->nobp = ($request->nobp == null) ? false : true;
        //搜索
        $response->searchWords = $this->getHotSearchWords();
        List($blueImage, $redImage) = $this->getHomeBigImage();
        $response->blueImage = $blueImage;
        $response->redImage = $redImage;
        //在线专家
        $response->onLineDoctorList = DoctorClient::getInstance()->getOnLineDoctor4HomePage();

        //按医院找大夫
        $provList = $this->getProvList();
        $provKeyList = $this->getProvKey();
        $hospitalIds = array();
        foreach ($provList as $p => $prov)
        {
            foreach ($prov as $h => $hospital)
            {
                $hospitalIds[] = $h;
            }
        }
        $response->hospitalList = DAL::get()->find('hospital', $hospitalIds);
        $response->provList = $provList;
        $response->provKeyList = $provKeyList;

                
        //咨询专家 咨询列表
        $response->doctorPatientSets = $this->getFlowList4HomePage(self::THREADCATEGORY_COUNT, self::THREAD_COUNT);
        $response->statistics = SpaceClient::getInstance()->getStatistics();

        //咨询专家 电话咨询列表
		$recommendDoctorList = PaymentClient::getInstance()->getRecDoctorList4HomePage(10, 3);
        $response->recommendDoctorList = $recommendDoctorList; 
        $spaceUserIds = $doctorIds = array();
        foreach ($recommendDoctorList as $facultyInfo)
        {
            $facultyDoctorInfo = isset($facultyInfo['doctor']) ? $facultyInfo['doctor'] : array();
            foreach ($facultyDoctorInfo as $doctor)
            {
                $spaceUserIds[] = $doctor->getSpace()->user->id;
                $doctorIds[] = $doctor->id;
            }
        }

		$productList = $lastOrders = array();
		if(!empty($spaceUserIds) && !empty($doctorIds))
		{
			//电话咨询产品
			$productList = ProductClient::getInstance()->getProductsBySpaceIds($spaceUserIds, array(ServiceDef::TYPE_TELORDER));
			//取最新订单
			$lastOrders = PaymentClient::getInstance()->getLatestServiceList($doctorIds);
		}
		$response->productList = $productList;
        $lastOrderGroupBySpace = array();
        foreach ($lastOrders as $lastOrder)
        {
            if ($lastOrder->getSpace() instanceof Space)
            {
                $lastOrderGroupBySpace[$lastOrder->getSpace()->id] = $lastOrder;
            } 
        }
        $response->lastOrderGroupBySpace = $lastOrderGroupBySpace;

        //预约加号
        $doctorNumber = PlussignChannelClient::getInstance()->getPlusSignDoctorCount();//全国开通加号医生总数目
        $patientNumber = SpaceClient::getInstance()->getPlusSignPatientCount();
        $patientOrderList = PatientClient::getInstance()->getPatientOrderList();
        $response->doctorNumber = $doctorNumber;
        $response->patientNumber = $patientNumber;	
        $response->patientOrderList = $patientOrderList;

        //分享经验
        $commentCount = DoctorCommentClient::getInstance()->getCommentCount();
        $response->thankListCount = isset($commentCount['letter']) ? $commentCount['letter'] : 0;
        $response->doctorCommentListCount = isset($commentCount['comment']) ? $commentCount['comment'] : 0;

        $expList = DAL::get()->find_all_for_top('cureexp', 4);
        $response->expList = $expList;

        $thankList = DAL::get()->find_all_for_top('curethankletter', 4);
        $response->thankList = $thankList;        

        //出诊 停诊信息
        $response->hospitalAnnounceList = HospitalClient::getInstance()->getHospitalAnnounceList4HomePage(3);
        $response->cmslinkList = CmsClient::getInstance()->getCmsLinkList(self::CMS_COUNT);

        //好大夫动态
        $response->latestList = SpaceLogClient::getInstance()->getLatestList(self::LAST_COUNT);
        $response->images = $this->_images;

        //礼物动态
        $spaceId = 0;
        $result = PresentClient::getInstance()->showPresentBanner($spaceId, 12, $request->from, array(), false);
        $response->presentOrders = $result['presentOrders'];

        //最新专家文章
        $limit = self::ARTICLE_COUNT - substr_count(Place::getPlaceContent('haodf_index','wenzhang_url','onlyone'), '<li>');
        $articleList = ArticleClient::getInstance()->getArticleList4Index($limit);
        $response->articleList = $articleList;
    }/*}}}*/
 public function returnPresentOrder($request, $response)
 {/*{{{*/
     $from = $request->from;
     $orderId = $request->orderId;
     if('present' == $from)
     {
         PresentClient::getInstance()->returnPresentOrder($orderId);
         $response->setRedirect($response->router->urlfor('telpayment/showtelaccount'));
     }
     return parent::DIRECT_OUTPUT;
 }/*}}}*/
    public function index($request, $response)
    {/*{{{*/
        
        //CMS-904,暂时下线航天总医院的首页
        //CMS-907,暂时下线北京731医院的首页,等待通知后恢复
        $skipHospitalIds = array(197,2262);
        if(in_array($this->_hospital->id, $skipHospitalIds))
        {
            //DC-335
            //$response->setRedirect('http://www.'.URL_PREFIX.'haodf.com/info/spacefrontnotice.php');
            //return;
        }

        //BIZARC-2810  丰台区妇幼保健院以及其下科室,个人信息页面屏蔽
        $noRecordHospitalIds = array(1867, 189);
        if(in_array($this->_hospital->id, $noRecordHospitalIds))
        {
            //DC-335
            //$response->setRedirect('http://www.'.URL_PREFIX.'haodf.com/info/norecordhospitalnotice.php');
            //return;
        }
        
		//显示科室列表
		$response->hospitalFacultyList = $this->_hospital->getHospitalFacultyList(HospitalFaculty::IS_SELECT_FACULTY_BY_VOTE_NO);
		
		//热门讨论疾病
		$response->diseaseHospitalList = HospitalClient::getInstance()
			->getHotDiseaseList($this->_hospital->id, self::INDEX_DISEASE_HOSPITAL_NUM);
        $diseaseDoctorList = array();
        if ($response->diseaseHospitalList)
        {
            $diseaseDoctorList = DiseaseClient::getInstance()
                                    ->getDiseaseDoctorByHospitalGroupByDisease($response->diseaseHospitalList, $this->_hospital->id, self::INDEX_DISEASE_DOCTOR_NUM);
        }
        $response->diseaseDoctorList = $diseaseDoctorList;

		//case doctor
		$response->spaceList = SpaceClient::getInstance()->getCaseOpenedSpace4Hospital($this->_hospital->id);
		
		//判断医院是否有加号入口
		$response->isPlus = PlussignChannelClient::getInstance()->isHospitalBookDoctor($this->_hospital->commonName);
		//此医院开通加号的大夫人数
		$response->openBookingCount = HospitalClient::getInstance()
			->getDoctorCountByHospitalCommonName($this->_hospital->commonName);

		//在此医院成功加号的人数
		$response->successBookingCount = BookingClient::getInstance()->getSuccessBookingCountByHospital($this->_hospital->id);
        //此医院可直接电话咨询的人数
        $pagesize = 10;

        //最新咨询
        $spaceIds = DAL::get()->find_id_byHospitalId('space', $this->_hospital->id, 30);
        $response->doctorPatientRefs = FlowClient::getInstance()->getLastDoctorPatientPosts($spaceIds, self::INDEX_CASE_NUM);		

		//取医院所有注册医生id ,取文章,咨询用,z专家观点
		$tmpArticle = ArticleClient::getInstance()->getListByHospital($this->_hospital->id, array('level'=>'>=2', 'type'=>'=0'), 
			array('limit'=>self::INDEX_ARTICLE_NUM));
		$response->articleList = $tmpArticle['articleList'];
		
        //专题
        List($zhuanTiCount, $zhuanTis) = $this->getZhuanTiListByHospital($this->_hospital->id);
		$response->zhuanTis = array_slice($zhuanTis,0,10);
        
        $option['commentType'] = DoctorComment::COMMENT_TYPE_THANK_LETTER;  
        $option['hospital'] = $this->_hospital->id;
        $pageInfo['pageSize'] = self::SIDE_THANKS_NUM;                                                          
        $pageInfo['nowPage'] = 1;
        $thankLetterList = DoctorCommentClient::getInstance()->getCommentList($option, $pageInfo);
		$response->thankLetterList =$thankLetterList['commentList']; 
		$response->thankLetterCount = $thankLetterList['pageInfo']['total'];
        
        $option['commentType'] = DoctorComment::COMMENT_TYPE_PROCESS;  
        $option['hospital'] = $this->_hospital->id;
        $pageInfo['pageSize'] = self::SIDE_COMMENT_NUM;                                                         
        $pageInfo['nowPage'] = 1;
		$commentList = DoctorCommentClient::getInstance()->getCommentList($option, $pageInfo);
		$response->commentList = $commentList['commentList'];
		
		// meta
		if ($this->_hospital->doctorCount>2)
			$response->title = "{$this->_hospital->commonName}_科室列表,咨询{$this->_hospital->commonName}
				{$this->_hospital->spaceCount}位大夫_好大夫在线";
		else
			$response->title = "{$this->_hospital->commonName}_科室列表,门诊时间,专家推荐_好大夫在线";
		
		$response->keywords = "{$this->_hospital->name},{$this->_hospital->commonName},{$this->_hospital->aliases}";	
		
		if($this->_hospital->id==2118) {
			$description = mb_substr(strip_tags($this->_hospital->intro), 0, 70, 'gbk');
		} else {
			$description = "收录{$this->_hospital->commonName}{$this->_hospital->facultyCount}
				个科室、{$this->_hospital->doctorCount}位医生的详细介绍、";
			$description .= $this->_hospital->isDailyUpdate()? 
				'专家门诊时间于'.$this->_hospital->hospitalAnnounce->utime->toStringByFormat('m月d日更新').'、':'';
			$description .= ($this->_hospital->commentCount>10)? $this->_hospital->commentCount.'篇实用看病经验、' : '';
			$description .= ($this->_hospital->doctorCount>3)? $this->_hospital->doctorCount.'位大夫在线咨询' : '';
			$description .= "。地址:{$this->_hospital->address};电话:{$this->_hospital->phone}";
		}
		$response->description = $description;
		$response->modules = $this->_modules;
		$response->pageModule = 'index';

        $this->getSidePhoneServiceListByHospital($response);

        //礼物动态
        $response->statistics = SpaceClient::getInstance()->getStatistics();
        $spaceAllIds = DAL::get()->find_id_byHospitalId('space', $this->_hospital->id);      
        $spaceId = 0;
        $result = PresentClient::getInstance()->showPresentBanner($spaceId, 12, $request->from, $spaceAllIds); 
        $response->presentOrders = $result['presentOrders'];                                     

        $response->moreFlowList = FlowClient::getInstance()->getFlowList4SEO($num = 10, $this->_hospital->id);
	}/*}}}*/
Пример #4
0
 /**
  * @brief 搜不到页面引用
  * @author lhl
  * @version branches/v2.14.23
  * @date 2013-07-25
  */
 public function spaceModules($request, $response)
 {
     /*{{{*/
     $doctorServices = SpaceClient::getInstance()->getServiceInfo($this->space->id, $this->user->id);
     $presentCnts = PresentClient::getInstance()->getCntOfPresent($this->space->id);
     $response->doctorServices = $doctorServices;
     $response->presentCnts = $presentCnts;
 }
Пример #5
0
 public function sendPresent($request, $response)
 {
     /*{{{*/
     $patient = DAL::get()->find('patient', $request->patientid);
     $space = DAL::get()->find('space', $request->spaceid);
     $cashCoupon = DAL::get()->find('cashcoupon', $request->couponid);
     $mes = "礼物无效或订单创建失败!请重试!";
     if ($cashCoupon->isNull()) {
         throw new BizException('代金券无效!');
     }
     //$presentId = (CashCoupon::PRICE_10 == $cashCoupon->price)?(Present::GEHL_PRESENT_ID):(Present::YDGS_PRESENT_ID);
     $presentId = CashCoupon::PRICE_10 == $cashCoupon->price ? Present::TEST_GNHL_PRESENT_ID : Present::TEST_YDGS_PRESENT_ID;
     $present = DAL::get()->find('Present', $presentId);
     $result = 4;
     if (false == $present->isNull()) {
         $presentOrder = PresentClient::getInstance()->createOrder($patient->user, $patient, $space, $present, "");
     }
     if (Account::PAY_RESULT_FAIL_COUPON == $result) {
         $mes = "代金券支付失败!";
     } else {
         if (Account::PAY_RESULT_SUCC == $result) {
             AsyncSendMessage::regAsyncMessage($presentOrder);
             //发送站内信
             $mes = "{$cashCoupon->price}元代金券使用成功!";
         }
     }
     $response->setRedirect($response->router->urlfor('present/showtelorder?message=' . $mes));
 }
Пример #6
0
 /**
     * @brief  设置Case已读 返回下一条的内容 type::thread,flow
     * @author zhb
     * @exampleUrl http://dev.mobile-api.haodf.com/doctorapi/flowref_setcaseread?userId=309570&xdoc=1
     *
     *
  */
 public function setCaseRead($userId, $patientId, $caseType, $lastPostTime, $caseId = '', $tabType)
 {/*{{{*/
     $thread = $this->getCaseByCaseIdAndCaseType($userId, $patientId, $caseId, $caseType);
     if(is_numeric($thread))
     {
         $this->setErrorCode($thread);
         return 0;
     }
     if($thread instanceof DoctorPatientRef)
     {
         FlowClient::getInstance()->setSpaceRead($thread->id);
         PresentClient::getInstance()->setSpaceRead($userId, $patientId);
         $flow = DAL::get()->find('DoctorPatientRef', $thread->id, true);
     }
     if($thread instanceof Proposal)
     {
         ProposalClient::getInstance()->markRead($thread);
         $newThread = DAL::get()->find('Proposal', $thread->id, true); 
         $lastUpTime = $newThread->utime; 
     }
     $info = array();
     if(isset($lastUpTime))
     {
         $lastPostTime = $lastUpTime;
     }
     $threads = $this->getNextCasePostListBySpaceIdAndLastPostTime($userId, $lastPostTime, $caseType, $tabType, $thread->id);
     $info['nextPatientId'] = 0;
     $info['nextCaseId'] = 0;
     $info['nextCaseType'] = '';
     $info['lastUpTime'] = '';
     if(false == empty($threads))
     {
         $thread = array_shift($threads);
         $info['nextPatientId'] = $thread->patient->id;
         $info['nextCaseId'] = $thread->id;
         $info['nextCaseType'] = 'thread';
         $info['lastUpTime'] = isset($lastUpTime) ? $lastUpTime : '';
         if($thread instanceof DoctorPatientRef)
         {
             $info['nextCaseType'] = 'flow';
         }
     }
     $this->content = $info;
 }/*}}}*/
Пример #7
0
    public function ajaxDoctorBuyPresent($request, $response)
    {/*{{{*/
        $canSend = true;
        $errorMsg = '';
        if($this->_newUser->id != $this->_newSpace->user->id)
        {
            $canSend = false;
            $errorMsg = "您不能代替{$this->_newSpace->name}医生送礼物!";
        }
        $response->errorMsg = $errorMsg;
        if(false == $canSend)
        {
            return 'ajaxfailsent';
        }

        $present = DAL::get()->find('Present', $request->presentid);
        $patient = DAL::get()->find('patient', $request->patientid);
        $presentOrder = PresentClient::getInstance()->createOrder($this->_newSpace->user, $patient
            , $this->_newSpace, $present, $request->wish, false);

        $result = 4;
        if(false == $presentOrder->isNull())
        {
            $result =  ScoreClient::getInstance()->payForPresent($this->_newSpace->user->id, $this->_newSpace->id, $presentOrder->id);
        }
        if(Account::PAY_RESULT_SUCC == $result)
        {
            $ref = DAL::get()->find_by_spaceid_and_patientid_and_status('doctorpatientref'
                , $this->_newSpace->id, $request->patientid, DoctorPatientRef::STATUS_INIT);
            $response->ref = $ref;

            $title = "医生送祝福";
            $content = "{$patient->user->name}您好。<p>{$this->_newSpace->name}大夫亲自为您送祝福 {$present->name} </p><p><a href='{$ref->getUrl()}' class='blue' target='_blank'>立即查看</a>或<a href='{$ref->getUrl()}?type=presentchoose' class='blue' target='_blank'>我要回赠医生礼物</a></p>";
            StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $patient->user->id, $title, $content);

            return 'ajaxdoctorsuccesssent';
        }
        else
        {
            $errorMsg = '订单提交失败';
            $response->errorMsg = $errorMsg;
            return 'ajaxfailsent';
        }
    }/*}}}*/
Пример #8
0
    public function promotion($request, $response)
    {/*{{{*/
        $response->title = '感恩答谢';
        $space = SpaceClient::getInstance()->getAnyOneSpace();
        $response->space = $space;
        $params = array();
        $params['limit'] = 3;
        $params['isOnline'] = true;
        $params['hasStock'] = true;
        $popularResult = PresentClient::getInstance()->getPresentsAndSoldCnt($params);
        $response->popularPresents = $popularResult['presents'];

        $recommendPresents = PresentClient::getInstance()->getRecommendedPresents();
        $recommendPresent = array_shift($recommendPresents);
        $response->recommendPresent = $recommendPresent;

        //flow
        $orderby = "postcount";
        $groupby = "spaceid";
        $arr = array(
            'status' => DoctorPatientRef::STATUS_INIT,
            'orderby' => $orderby,
            'groupby' => $groupby,
            );
        $limit = $request->limit;
        $response->limit = $limit;
        if($this->curUser->id)
        {
            $flows = FlowClient::getInstance()->getFlowListByUser($this->curUser->id, $arr);
        }
        if($this->curUser->isNull() || 0 == count($flows))
        {
            $response->allowSend = false;
            $num = 3;
            $heartResult = PresentClient::getInstance()->getBoardByType(SpaceHeartBillboard::TYPE_WEEK,$num);
            $spaceHeartWeekBillboards = $heartResult['rank'];
            $response->spaceHeartWeekBillboards = $spaceHeartWeekBillboards;
        }
        else
        {
             $flowList = array();
             foreach($flows as $flow)
            {
                if($flow->space->host instanceof Doctor)
                {
                    $flowList[] = $flow;
                }
            }
            foreach($flowList as $flow)
            {
                $thankLetterCounts[$flow->id] = $flow->space->host->getCureThankLetterCount();
            }
            $response->refs = ($limit == "all") ? $flowList : array_slice($flowList, 0, 6);
            $response->refCount = count($flowList);
            $response->thankLetterCounts = $thankLetterCounts;
        }
            
            //礼物列表
            
            $page = 1;
            $pageSize = 200;
            $options = array();
            $options['categoryid'] = $request->getRequest('categoryid', 0);
            $options['hasStock'] = true;
            $listResult = PresentClient::getInstance()->showPresentList4Front($page, $pageSize, $options);
            $response->presentList = $listResult['presents'];
            //动态
            $spaceId = 0;
            $bannerResult = PresentClient::getInstance()->showPresentBanner($spaceId, 8);
            $response->onePresentOrders = array_slice($bannerResult['presentOrders'], 0, 4);
            $response->threePresentOrders = array_slice($bannerResult['presentOrders'], 4, 4);
            $response->statistics = SpaceClient::getInstance()->getStatistics();
            //最新礼物更新(临时写,下期更新后就下掉)                                                             
            $newPresents = DAL::get()->find_all_by_condition('Present', 'name in ("马到成功", "吉祥如意")');
            foreach ($newPresents as $presentKey=>$newPresent)
            {
                $newPresents[$newPresent->name] = $newPresent;
                unset($newPresents[$presentKey]);
            }
            $response->presentMdcg = $newPresents['马到成功'];
            $response->presentJxry = $newPresents['吉祥如意'];
    }/*}}}*/
Пример #9
0
 /** 获取医生信息 **/
 private function getDoctorInfo($request, $response)
 {
     /*{{{*/
     $response->belongDoctors = DoctorClient::getInstance()->getDoctorList4space($this->space->user->id);
     $thankLetterCount = 0;
     $presentCnt = 0;
     if ($this->space->isDoctor()) {
         $thankLetterCount = $this->space->host->getCureThankLetterCount();
         $presentCnt = PresentClient::getInstance()->getCntOfPresent($this->space->id);
         //贡献值
         $res = ScoreClient::getInstance()->getScoreByUserIdGroupByCate($this->space->id);
         if (isset($res[Account::CATE_SCORE][Account::TYPE_PRESENT])) {
             $response->contributionAmount = $res[Account::CATE_SCORE][Account::TYPE_PRESENT];
         } else {
             $response->contributionAmount = 0;
         }
         //爱心图片
         list($featAmount, $heartImgHtml) = ScoreClient::getInstance()->showFlagsforPage($this->space->user->id);
         $response->heartImgHtml = $heartImgHtml;
         //爱心值
         $response->featAmount = $featAmount;
     }
     $response->thankLetterCount = $thankLetterCount;
     $response->presentCnt = $presentCnt;
 }
	public function index($request, $response)
	{/*{{{*/
		$this->initialize($request, $response);

        //BIZARC-2810  丰台区妇幼保健院以及其下科室,个人信息页面屏蔽
        $noRecordHospitalIds = array(1867);
        if(in_array($this->hospitalFaculty->hospital->id, $noRecordHospitalIds))
        {
            //DC-335
            //$response->setRedirect('http://www.'.URL_PREFIX.'haodf.com/info/norecordhospitalnotice.php');
            //return;
        }

		$hospitalFaculty = $this->hospitalFaculty;
		$response->hospitalFacultyId = Codec::getInstance()->encodeId($hospitalFaculty->id);
		
		if($hospitalFaculty->isNull()){
			exit('你访问的科室不存在');
		}

		if($hospitalFaculty->isVirtual) {
			$this->virtualIndex($request, $response);
			return self::VIRTUAL_FACULTY;
		}
		
		if ($hospitalFaculty->doctorCount > 0) {
			$title = $hospitalFaculty->hospital->commonName.$hospitalFaculty->name.'_好大夫在线';
		} else {
			$title = $hospitalFaculty->hospital->commonName.$hospitalFaculty->name.'_科室列表,门诊时间,专家推荐_好大夫在线';
		}
		//描述SEO
		$descString = $hospitalFaculty->hospital->commonName.$hospitalFaculty->name."专家列表,"
			.$hospitalFaculty->doctorCount."位医生详细介绍和门诊时间、".$hospitalFaculty->voteCount."篇患者发表的看病经验、按疾病推荐专家、"
			.$hospitalFaculty->expertCount."位专家在线咨询,免费预约".$hospitalFaculty->hospital->commonName.$hospitalFaculty->name."专家门诊。"; 
		
		//关键词SEO
		$hospitalFacultyNameList = array($hospitalFaculty->name, $hospitalFaculty->faculty->parentName);
		if ($hospitalFaculty->faculty->alias)
		{
			$hospitalFacultyNameList =array_merge($hospitalFacultyNameList, explode(',', $hospitalFaculty->faculty->alias));
		}
		$keywords = '';
		$hospitalFacultyNameList = array_unique($hospitalFacultyNameList);
		if ($hospitalFacultyNameList)
		{
			foreach ($hospitalFacultyNameList as $hospitalFacultyName)
			{
				if ($keywords)
				{
					$keywords .= ','.$hospitalFaculty->hospital->commonName.$hospitalFacultyName;
				}
				else
				{
					$keywords .= $hospitalFaculty->hospital->commonName.$hospitalFacultyName;
				}
			}
		}
		//患者投票
		$diseaseHospitalFacultyList = DiseaseClient::getInstance()->getDiseaseHospitalFacultyListByHospitalFaculty($hospitalFaculty->id, self::DISEASE_NUMBER);
		
        $diseaseDoctorList =  DiseaseClient::getInstance()->getDiseaseAndDoctorListByHospitalFaculty($hospitalFaculty->id);
		$response->diseaseRes = $diseaseDoctorList['disease'];
		$response->facultyExperts = $diseaseDoctorList['doctor'];
		$response->hospitalid = Codec::getInstance()->encodeId($hospitalFaculty->hospital->id);
		
		$spaceIds = $this->getSpaceIds($hospitalFaculty->id, self::SPACE_NUMBER);
		$this->getDoctorList($request, $response);
	    //10条最新文章
		List($articleList,$pageLink)=$this->getArticleList($spaceIds, 1, self::ARTICLE_NUMBER);
		
        //专题
        List($zhuanTiCount, $zhuanTis) = $this->getZhuantiListByFaculty($this->hospitalFaculty->faculty->id);
        $response->zhuanTis = array_slice($zhuanTis,0,10);
		
        //咨询大夫
        $doctorPatientRefs = FlowClient::getInstance()->getLastDoctorPatientPosts($spaceIds, self::DOCTOR_ONLINE_NUMBER);		
		
        //最新出、停诊时间
		$scheduleOfflineList = DoctorClient::getInstance()->getScheduleListByHospitalFaculty($hospitalFaculty->id);
        //患者看病经验
        $option['hospitalFaculty'] = $hospitalFaculty->id;
        $option['commentType'] = DoctorComment::COMMENT_TYPE_PROCESS;
        $pageInfo['pageSize'] = 4;
        $result = DoctorCommentClient::getInstance()->getCommentList($option, $pageInfo);
        //感谢信
        List($letterList, $lettersCount, $letterpageLink) = $this->getLetterList(1, self::LETTERS_NUMBER);

        //礼物动态
        $response->statistics = SpaceClient::getInstance()->getStatistics();
        $spaceAllIds = $this->getSpaceIds($hospitalFaculty->id);
        $spaceId = 0;
        if(false == empty($spaceAllIds))
            $presentResult = PresentClient::getInstance()->showPresentBanner($spaceId, 12, $request->from, $spaceAllIds); 
        $response->presentOrders = isset($presentResult)?$presentResult['presentOrders']:array();                                     

		//此科室开通加号的大夫人数
		$openBookingCount = BookingClient::getInstance()->getOpenBookingDoctorCount($hospitalFaculty->hospital->id, $hospitalFaculty->faculty->name);
		//在此科室成功加号的人数
		$successBookingCount = BookingClient::getInstance()->getSuccessBookingCountByFaculty($hospitalFaculty->id);		

        //在此科室最新执行电话咨询订单的医生
        $this->getSidePhoneServiceListByHF($this->hospitalFaculty, $response);
		
		//同地区同科室推荐医院
		$hospitalFacultyList = DoctorClient::getInstance()->getHospitalFacultyListByAreaFaculty($hospitalFaculty, 6);
		$response->provinceList = Area::provInfo();
		$response->commendHospitalFacultyList = $hospitalFacultyList['list'];
		$response->commendHospitalFacultyCnt = $hospitalFacultyList['cnt'];
		
		$response->experienceList = $result['commentList'];
		$response->title = $title; 
		$response->pageModule = 'index';
		$response->currentSite = '首页';
		$response->descString = $descString;
		$response->keywords = $keywords;
		$response->diseaseHospitalFacultyList = $diseaseHospitalFacultyList;
		$response->doctorPatientRefs = $doctorPatientRefs;
		$response->scheduleOfflineList = $scheduleOfflineList;
		$response->scheduleOfflineNumber = self::DOCTOR_ONLINE_NUMBER;
		$response->openBookingCount = $openBookingCount;
		$response->successBookingCount = $successBookingCount;
		$response->articleList = $articleList;
		$response->articlepageLink = $pageLink;
		$response->letterList = $letterList;
		$response->lettersCount = $lettersCount;
		$response->letterpageLink = $letterpageLink;
        $response->spaceList = SpaceClient::getInstance()->getListByHostIdsAndTypeWithDoctorIndex($response->doctorList);

        //dodo::wxy 添加本医院本科室最新通话大夫
        $infos = DoctorClient::getInstance()->getDoctorListFor400Search(array(), $hospitalFaculty->hospital->province, $hospitalFaculty->faculty->name, $hospitalFaculty->hospital->commonName,  $nowpage=20, $pagesize=20);
        $response->phoneAnswerCount = $infos['pageInfo']['total'];

		return parent::SUCCESS;
	}/*}}}*/
Пример #11
0
<p
class="pb5">擅长疾病:<a
href="<?=$doctor->getSpace()->getUrl()?>" target="_blank"
class="gray2"><?=XString::truncate($doctor->specialize, 30)?><font
class="f8"></font></a></p>    

<p
class="pb5">

感谢信:<a
target="_blank" href="<?=$doctor->getThankLetterUrl()?>"
class="look_a"><span
class="look_num"><?=$doctor->getCureThankLetterCount()?></span>&nbsp;封</a>
|
<?php
$presentCnt = PresentClient::getInstance()->getCntOfPresent($doctor->getSpace()->id);
?>
收到礼物:<a
target="_blank" href="<?=$doctor->getThankLetterUrl()."?ajaxto=showPresent"?>"
class="look_a"><span
class="look_num"><?=$presentCnt?></span>&nbsp;个</a>

</p>

<?php } ?>
</div>

</div>
<?php } ?>
<!--好大夫出诊
end-->
Пример #12
0
 private function getFlowPresentUserIds($flowList, $browserFlowList = array())
 {
     /*{{{*/
     $patientIds = array();
     if (false == empty($browserFlowList)) {
         foreach ($browserFlowList as $browserFlow) {
             $patientIds[] = $browserFlow->patient->id;
         }
     }
     if (isset($flowList) && false == empty($flowList)) {
         foreach ($flowList as $flow) {
             $patientIds[] = $flow->patient->id;
         }
     }
     $userIds = array();
     if (isset($patientIds) && false == empty($patientIds)) {
         $options = array();
         $options['spaceId'] = $this->space->id;
         $options['patientIds'] = $patientIds;
         $options['notSpacePresent'] = true;
         $userIds = PresentClient::getInstance()->getPatientIdsSentPresent($options);
     }
     return $userIds;
 }
Пример #13
0
	/** 文章详细(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]);
        $articleContect = str_replace('&nbsp;', '', $articleContentArr[0]);
        $response->articleContect = str_replace('"', '', strip_tags($articleContect));
        //dodo::wxy 新增医生接听电话数
		$doctorAnswerPhoneList = PaymentClient::getInstance()->getDoctorSatisfactionCntList($this->_newSpace->id);
        $doctorAnswerPhoneCount = 0;
        if(false == empty($doctorAnswerPhoneList))
        {
            $doctorAnswerPhoneCount = $doctorAnswerPhoneList[0]['cnt'];
        };
        $response->doctorAnswerPhoneCount = $doctorAnswerPhoneCount;

        $commentsCount = 0;
        $comments = PaymentClient::getInstance()->getDoctorSatisfactionList($this->_newSpace->host->id);
        if(false == empty($comments[$this->_newSpace->host->id]['scorecnt']))
        {
            $commentsCount = $comments[$this->_newSpace->host->id]['scorecnt'];
        }
        $response->commentsCount = $commentsCount;

        $anyOneSpace = SpaceClient::getInstance()->getAnyOneSpace();
        $response->anyOneSpace = $anyOneSpace;
        $response->flows = FlowClient::getInstance()->getFlowListByUser($this->_newUser->id, array('status' => DoctorPatientRef::STATUS_INIT, 'limit'=>10));
        $articleAttachmentRef = new NullEntity();
        if ($article->hasDocAttachment())
        {
            $articleAttachmentRef = ArticleClient::getInstance()->getValidAttachmentRef($article->id);
        }
        $response->articleAttachmentRef = $articleAttachmentRef;
        $response->token = Captcha::generate('article', $article->id, ContentFactory::TYPE_ARITHMATIC, 4, XIpLocation::getIp(), 3);
	}/*}}}*/
<span class="f_more f8">&gt;&gt;</span></a></p>
</div>                       
<div class="number">

<?php 
if (0 < $doctor->getGoodVoteCount()) {
    $diseaseDoctor =
    DAL::get()->find_by_fld_diseaseid_and_fld_doctorid('DiseaseDoctor', $diseasePage->getVoteDiseaseId(),
    $doctor->id);
    ?>
<p><a href="http://www.<?=URL_PREFIX?>haodf.com/doctor/<?=$doctor->getEncodeId()?>/jibingjingyan/<?=$disease->key?>.htm" target="_blank">患者好评<span class="text_u"><?=$diseaseDoctor->goodVoteCount?></span>票</a></p>
<?php } ?>

<?php  
if (false == $space->isNull()){ 
$presentCnt = PresentClient::getInstance()->getCntOfPresent($space->id);
if (isset($postCount) && $postCount > 0){ ?>
<p><a href="http://www.<?=URL_PREFIX?><?=$space->userName?>.haodf.com/zixun/list.htm" target="_blank">近两周回复<span class="text_u"><?=$postCount?></span>问</a></p>
<?php } } ?>

<?php 
        $commentDiseaseGroup = DoctorCommentClient::getInstance()->queryCommentDiseaseGroup($doctor->getPrimaryDoctor());
        $kanbingjyCnt = 0;
        foreach($commentDiseaseGroup as $groupInfo)
        {
            if ($diseasePage->getVoteDiseaseId() == $groupInfo['diseaseid'])
            {
                $kanbingjyCnt = $groupInfo['cnt'];
                break;
            }
        }
Пример #15
0
 public function ajaxChangeMobile($request, $response)
 {
     /*{{{*/
     $mobile = $request->mobile;
     $id = Codec::getInstance()->decodeId($request->id);
     $result = PresentClient::getInstance()->changePresentOrderMobile($mobile, $id, $this->user->id);
     if ($result) {
         echo '{"res":"success", "msg":"手机号码修改成功"}';
     } else {
         echo '{"res":"failure", "msg":"手机号码修改失败"}';
     }
     return self::DIRECT_OUTPUT;
 }
 public function showPresentOrderList($request, $response)
 {
     /*{{{*/
     $options = array();
     $options['nowPage'] = $request->page ? $request->page : 1;
     $options['pageSize'] = 10;
     $options['spaceId'] = $this->space->id;
     $options['status'] = PresentOrder::STATUS_PAID_YES;
     $options['startTime'] = $beginDate = $request->beginDate;
     $options['endTime'] = $endDate = $request->endDate;
     $options['notUserId'] = $this->space->user->id;
     $options['amount'] = 'amount';
     $res = PresentClient::getInstance()->getPresentOrders($options);
     $pagelink = PageNav::getNavLink(PageNav::getPageNavTemplateForSpace("showpresentorderlist?beginDate={$beginDate}&endDate={$endDate}&actionclass={$request->actionclass}&page="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
     $response->presentOrderList = $res['presentOrderList'];
     $response->space = $this->space;
     $response->beginDate = $beginDate;
     $response->endDate = $endDate;
     $response->actionClass = $request->actionclass;
     $response->pagelink = $pagelink;
 }
Пример #17
0
 private function getPatientIdsSentFlower($spaceId, $flowList, $currentUserFlowList)
 {
     /*{{{*/
     $result = array();
     if ($flowList && false == empty($flowList)) {
         $patientIds = array();
         foreach ($flowList as $flow) {
             $patientIds[] = $flow->patient->id;
         }
         foreach ($currentUserFlowList as $currentUserFlow) {
             $patientIds[] = $currentUserFlow->patient->id;
         }
         $options = array();
         $options['spaceId'] = $spaceId;
         $options['patientIds'] = $patientIds;
         $result = PresentClient::getInstance()->getPatientIdsSentPresent($options);
     }
     return $result;
 }
Пример #18
0
    public function setCaseRead($spaceId, $patientId, $type, $lastPostTime, $caseId = '')
    {/*{{{*/
        $thread = $this->getCaseByCaseIdAndCaseType($spaceId, $patientId, $caseId, $type);
        if(is_numeric($thread))
        {
            $this->setErrorCode($thread);
            return 0;
        }
        if($thread instanceof DoctorPatientRef)
        {
            FlowClient::getInstance()->setSpaceRead($thread->id);
            PresentClient::getInstance()->setSpaceRead($spaceId, $patientId);
            $flow = DAL::get()->find('DoctorPatientRef', $thread->id, true);
        }
        if($thread instanceof Proposal)
        {
           // ThreadClient::getInstance()->setThreadRead($thread->id);
            ProposalClient::getInstance()->markRead($thread);
        }
        $info = array();
        $threads = $this->getNextCasePostListBySpaceIdAndLastPostTime($spaceId, $lastPostTime, $type);
        $info['nextPatientId'] = 0;
        $info['nextCaseId'] = 0;
        $info['nextCaseType'] = '';
        if(false == empty($threads))
        {
            $thread = array_shift($threads);
            $info['nextPatientId'] = $thread->patient->id;
            $info['nextCaseId'] = $thread->id;
            $info['nextCaseType'] = 'thread';
            if($thread instanceof DoctorPatientRef)
            {
                $info['nextCaseType'] = 'flow';
            }
        }

        //todo::仅仅是debug
        if(isset($flow) && false == $flow->isSpaceRead())
        {
            error_log(strip_tags(print_r($flow, true))."\n", 3, "/tmp/set_case_read_wrong_data.log");
        }
        $this->content = $info;
    }/*}}}*/
Пример #19
0
    public function ajaxGetPresentList($request, $response)
    {/*{{{*/
        $encode_doctorId = $request->id;
		$doctorId = Codec::getInstance()->decodeId($encode_doctorId);
		$doctor = DAL::get()->find('Doctor', $doctorId);
        $response->isDead = $doctor->isDead();
        $presentOrderList = array();
        $pageLink = null;
        if(false == $doctor->isNull())
        {
            $page = (int)$request->getRequest('p', 1);
            $pageSize = 20;
            list($orders, $pageInfo) = PresentClient::getInstance()->getOrdersAndPageinfo($doctor->space->id, $page, $pageSize);
            if($pageInfo)
            {
            $pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate('?p='), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
            }
        }
		$response->pageLink = $pageLink;
        $response->presentOrderList = $orders;
        $response->encode_doctorId = $encode_doctorId;
    }/*}}}*/
Пример #20
0
    private function haveSentPresent($spaceId, $flowList, $currentUserFlowList=array())
    {/*{{{*/
        $result = array();
        if(null != $flowList && false == empty($flowList))
        {
            $patientIds = array();
            foreach($flowList as $flow)
            {
                $patientIds[] = $flow->patient->id;
            }

            if (false == empty($currentUserFlowList))
            {
                foreach($currentUserFlowList as $currentUserFlow)
                {
                    $patientIds[] = $currentUserFlow->patient->id;
                }
            }
            $options = array();
            $options['spaceId'] = $spaceId;
            $options['patientIds'] = $patientIds;
            $options['notSpacePresent'] = true;
            $result = PresentClient::getInstance()->getPatientIdsSentPresent($options);
        }
        return $result;
    }/*}}}*/
Пример #21
0
 public function present($request, $response)
 {/*{{{*/
     $pageSize = 9;
     $pageIndex = $request->getRequest('page', 1);
     $refs = PresentClient::getInstance()->getOrdersInFlow($this->user->id, $pageIndex, $pageSize);
     $response->orders = $refs['orders'];
     $pageInfo = $refs['pageInfo'];
     if($pageInfo)
     {
         $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate('?page='), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
     }
 }/*}}}*/