private function _doHospitalFacultyIndex($response)
	{
		/** 读取医生列表 */
		$res = DoctorClient::getInstance()->getPageListByHospitalFaculty($this->_newSpace->host->id, 1, 100);
		$doctorList = $res['doctorList'];
		
		$ids = array();
		foreach($doctorList as $doctor){
			$ids[] = $doctor->id;
		}
		$tables = DoctorClient::getInstance()->getFormatScheduleList($ids);
		
		$validDoctorList   = array();
		$disableDoctorList = array();
		$scheduleDataList = $this->_newSpace->getScheduleData();
		if(empty($scheduleDataList)){
			$validDoctorList = $doctorList;
		}else{
			foreach($scheduleDataList as $doctorId)
			{
				if($doctorList[$doctorId] == null)
					continue;
				$validDoctorList[$doctorId] = $doctorList[$doctorId];
				unset($doctorList[$doctorId]);
			}
			$disableDoctorList = $doctorList;
		}
		$response->validDoctorList = $validDoctorList;
		$response->disableDoctorList = $disableDoctorList;
		$response->tables = $tables;
	}
 private function getScheduleInfo($doctor)
 {/*{{{*/
     $scheduleResults = DoctorClient::getInstance()->getFormatScheduleList($doctor->id); 
     $scheduleInfos = array();
     foreach($scheduleResults[$doctor->id] as $key1 => $daySchedule)
     {
         if($key1 == 'isMoreSite')
         {
             continue;
         }
         foreach($daySchedule as $key2 => $schedule)
         {
             $tempInfo = array();
             if(isset($schedule['type']))
             {
                 $tempInfo['schedule']['hour'] = $this->getHourStr($key2);
                 $tempInfo['schedule']['week'] = $this->getDateTimeStr($key1);
                 $tempInfo['schedule']['type'] = $schedule['type'];
                 if(isset($schedule['fee']))
                 {
                     $tempInfo['schedule']['fee'] = $schedule['fee'];
                 }
                 else
                 {
                     $tempInfo['schedule']['fee'] = 0;
                 }
             }
             if(!empty($tempInfo))
             {
                 $scheduleInfos[] = $tempInfo;
             }
         }
     }
     return $scheduleInfos;
 }/*}}}*/
 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);
 }
    private function get3DoctorInfo($hospitalFaculty)
    {/*{{{*/
        $result = DoctorClient::getInstance()->getPageListByHospitalFaculty($hospitalFaculty->id, 1, 3, array(), true);
        $topDoctorList = $result['doctorList']; 
        if(count($topDoctorList) < 3)
        {
            $res = 3-count($topDoctorList);
            $result = DoctorClient::getInstance()->getPageListByHospitalFaculty($hospitalFaculty->id, 1, $res, array('title'=>''), false);
            $doctorList = array_merge($topDoctorList, $result['doctorList']);  
        }
        else
        {
            $doctorList = array_slice($topDoctorList, 0, 3);
        }

        $doctorInfos = array();
        foreach($doctorList as $key => $doctor)
        {
            $doctorInfos[$key]['doctor']['doctor_name'] = $doctor->name; 
            $doctorInfos[$key]['doctor']['doctor_pic'] = '';
            $doctorInfos[$key]['doctor']['doctor_title'] = $doctor->grade." ".$doctor->educateGrade;
            $doctorInfos[$key]['doctor']['good_at'] = $doctor->specialize;
            $doctorInfos[$key]['doctor']['doctor_link'] = $doctor->getTouchUrl();
        }
        return $doctorInfos;
    }/*}}}*/
	public function updateBaseInfo($request, $response)
	{
		$vars = $request->var;
		if ($request->is_ajax) {
			$vars = XString::toGbkDeep($vars);
		}
		if (!empty($vars['birthday']))
			$vars['birthday'] = XDateTime::valueOf($vars['birthday']);
		DoctorClient::getInstance()->modifyByDoctor($this->_newSpace->host->id, $vars);
		
		//调用同步新浪微博接口(更新医生个人信息和修改医生资料)
		//MessageQueueClient::getInstance()->regEvent(new UpdateDoctorInformationSinaWeiboEvent($this->_newSpace->user->id));
		if ($request->is_ajax)
		{
			$results = array(
				'grade' => XString::convertToUnicode($this->_newSpace->host->grade),
				'educate_grade' => XString::convertToUnicode($this->_newSpace->host->educateGrade),
				'specialize' => XString::convertToUnicode($this->_newSpace->host->specialize),
				'intro' => XString::convertToUnicode(XString::truncate($this->_newSpace->host->intro, 100)),
				'status' => 0,
			);
			echo json_encode($results);
			exit;
		}
        $this->message('您的医生资料提交成功!将在1个工作日内审核后生效!', $response, array(
            'buttons' => array(
                array('text' => '继续修改', 'url' => $this->_newSpace->getUrl()."admindoctor/showbaseinfo"),
                array('text' => '进入个人网站', 'url' => $this->_newSpace->getUrl())
            ),
        ));
	
	}
 public function recovery($request, $response)
 {
     /*{{{*/
     $result = DoctorClient::getInstance()->recoveryDoctorLog($request->ids);
     $response->result = $result;
     $response->actionDesc = "撤销";
     $response->id = implode(' ', $request->ids);
     return 'recoveryProcess';
 }
 public function doctorList($request, $response)
 {
     $id = $request->id;
     if ($id < 0) {
         exit('请选择医院科室');
     }
     $response->hospitalFaculty = DAL::get()->find('HospitalFaculty', $id);
     $response->doctorList = DoctorClient::getInstance()->getDoctorsByHospitalFaculty($id, 'fld_DoctorName');
 }
 protected function getData($nowPage,$pageSize)
 {/*{{{*/
     $doctorList = DoctorClient::getInstance()->getPageListByHospital($this->hospitalId, $nowPage, $pageSize);
     BeanFinder::get('LocalCache')->removeAll(); 
     $doctorInfoArray = array();
     foreach($doctorList['doctorList'] as $key => $doctorInfo)  
     { 
         $doctorInfoArray[] = array('item' => $this->getRealData($doctorInfo));
         unset($doctorInfo);
     }       
     return $doctorInfoArray;
 }/*}}}*/
예제 #9
0
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $option['commentPercentage'] = '0.6';
     $option['rate1Count'] = '0';
     $option['goodVoteCount'] = '2';
     $commentDoctorExts = CommentDoctorExtClient::getInstance()->queryCommentDoctorExtsByOption4SoSo($option, $nowPage, $pageSize);
     if (empty($commentDoctorExts))
     {
         return array();
     }
     $doctorIds = $this->getDoctorIds($commentDoctorExts);
     $comments = $this->getDoctorCommentList($doctorIds);
     $diseaseDoctors = DoctorClient::getInstance()->getDiseaseDoctorListGroupByDoctor($doctorIds);
     BeanFinder::get('LocalCache')->removeAll(); 
     return $this->buildData($commentDoctorExts, $comments, $diseaseDoctors);
 }/*}}}*/
 protected function getData($nowPage,$pageSize)
 {/*{{{*/
     $options = array();
     $spaceList = DoctorClient::getInstance()->getPageListByHospital($this->hospitalId, $nowPage, $pageSize, $options); 
     $spaceNoteArray = array();
     foreach($spaceList['doctorList'] as $doctor)
     {
         if ($doctor->hasSpace() && (false == empty($doctor->space->note1)|| false == empty($doctor->space->note2)))
         {
             $spaceNoteArray[] = array('item' => $this->getRealData($doctor));
             unset($doctor);
         }
     }
     BeanFinder::get('LocalCache')->removeAll(); 
     return $spaceNoteArray;
 }/*}}}*/
예제 #11
0
 public function doctorList($request, $response)
 {
     $id = $request->id;
     $hospital = DAL::get()->find('Hospital', $id);
     if ($hospital->isNull()) {
         exit('没有这家医院');
     }
     $option = array();
     $response->facultyName = $request->facultyName;
     $response->grade = $request->grade;
     $response->schedule = $request->schedule;
     $response->workStatus = $request->workStatus;
     $response->isRegisted = $request->isRegisted;
     if ($request->isStat) {
         //查询
         if ($request->facultyName >= 0) {
             $option['facultyName'] = $request->facultyName;
         }
         if ($request->grade >= 0) {
             $option['grade'] = $request->grade;
         }
         if ($request->schedule >= 0) {
             $option['schedule'] = $request->schedule;
         }
         if ($request->workStatus >= 0) {
             $option['workStatus'] = $request->workStatus;
         }
         if ($request->isRegisted >= 0) {
             $option['isRegisted'] = $request->isRegisted;
         }
     }
     $infoList = DoctorClient::getInstance()->getDoctorInfoListByHospital($hospital->id, $option);
     $hfList = array();
     foreach ($infoList as $info) {
         $hf['name'] = $info['hospitalfacultyname'];
         $hf['facultyname'] = $info['facultyname'];
         $hf['id'] = $info['hospitalfacultyid'];
         $hf['facultyid'] = $info['facultyid'];
         $hfList[$info['hospitalfacultyid']]['faculty'] = $hf;
         $hfList[$info['hospitalfacultyid']]['doctors'][] = $info;
     }
     $response->total = $hospital->doctorCount;
     $response->count = count($infoList);
     $response->hospital = $hospital;
     $response->hfList = $hfList;
     $response->isStat = $request->isStat;
 }
	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);
	}
예제 #13
0
 public function add($request, $response)
 {
     /*{{{*/
     if (false == $request->id) {
         $noteTitle = $request->noteTitle;
         $creatorId = $request->userId;
         $creatorName = $request->userName;
         $noteType = $request->noteType;
         $noteContent = $request->noteContent;
         $noteRemark = $request->noteRemark;
         $id = DoctorClient::getInstance()->addNoteBook($noteTitle, $creatorId, $creatorName, $noteType, $noteContent, $noteRemark);
     } else {
         $params = array('id' => $request->id, 'noteTitle' => $request->noteTitle, 'modifierId' => $request->userId, 'modifierName' => $request->userName, 'noteType' => $request->noteType, 'noteContent' => $request->noteContent, 'noteRemark' => $request->noteRemark, 'noteModifyTime' => XDateTime::now());
         $id = $request->id;
         DoctorClient::getInstance()->modifyNoteBook($id, $params);
     }
     $msg = "²Ù×÷³É¹¦ÁË£¡";
     $response->setRedirect('/notebook/showadd?id=' . $id . '&msg=' . urlencode($msg));
 }
예제 #14
0
    public function __construct($request, $response) 
    {/*{{{*/
        parent::__construct($request, $response);
		
        $response->controller = $request->controller;
        $response->action = $request->action;

        if ($_SERVER['HTTP_HOST'] == 'wenda.health.msn.com.cn') 
        {
            $imageUrl = 'https://wenda.health.msn.com.cn/partner';
        }
        else
        {
            $imageUrl = 'http://i1.hdfimg.com/partner';
        }
        $response->imageUrl = $imageUrl;
        
        $scheduleImgsArray = Schedule::$imgsArray;
       	$scheduleColorArray = array('普通' => 'normal', '专家' => 'expert', '专科' => 'special', '特需' => 'unique', 
       						 '会诊' => 'consultation', '夜间' => 'night', '其他' => 'other');
       	
       	$response->scheduleImgsArray = $scheduleImgsArray;
       	$response->scheduleTimeArray = array('上午', '下午', '夜间');
       	$response->scheduleTimeArray1 = array('上', '下', '夜');
       	$response->scheduleColorArray = $scheduleColorArray;
       	
       	$keys = array('DoctorCount','HospitalCount');
		$response->configInfo = DoctorClient::getInstance()->getConfigInfo($keys);

        $this->_newUser = UserClient::getInstance()->getCurrentUser();
        $this->_newSpace = new NullEntity();
        if(false == $this->_newUser->isNull())
        {
            if($this->_newUser->hasSpace())
            {
                $this->_newSpace = DAL::get()->find('space', $this->_newUser->id);
            }
        }
        $response->_newSpace = $this->_newSpace;
        $response->newUser = $this->_newUser;
        $response->_newUser = $this->_newUser;
    }/*}}}*/
 public function showEditPage($request, $response)
 {
     $hospitalAnnounceId = $request->id;
     $hospitalAnnounce = DAL::get()->find('HospitalAnnounce', $hospitalAnnounceId);
     $doctors = DoctorClient::getInstance()->getDoctorIdsAndNameByHospitalId($hospitalAnnounce->hospital->id);
     $tmp = str_replace(':', ':', strip_tags($hospitalAnnounce->content));
     $contentLink = '';
     preg_match_all('|:(\\S+)?.*\\r\\n|', $tmp, $matchDoctors);
     foreach ($matchDoctors[1] as $matchDoctor) {
         foreach ($doctors as $doctor) {
             if ($doctor['doctorname'] == $matchDoctor) {
                 $contentLink .= "<a target='_blank' href='/doctor/scheduledetail?id=" . $doctor['doctorid'] . "'>";
                 $contentLink .= $doctor['hospitalfacultyid'] . ':' . $doctor['doctorname'];
                 $contentLink .= '</a><br />';
             }
         }
     }
     $response->msg = $request->msg ? $request->msg : '';
     $response->hospitalAnnounce = $hospitalAnnounce;
     $response->contentLink = $contentLink;
 }
예제 #16
0
    private function getDiseaseDoctor($spaceList)
    {/*{{{*/
        $doctorIds = array();
        if ($spaceList)
        {
            foreach ($spaceList as $space)
            {
                $doctorIds[] = $space->host->id;
                unset($space);
            }
            $doctorIds = array_unique($doctorIds);
        }

        $diseaseDoctorList = array();
        if ($doctorIds)
        {
            $diseaseDoctorList = DoctorClient::getInstance()->getDiseaseDoctorListGroupByDoctor($doctorIds);
        }
        BeanFinder::get('LocalCache')->removeAll(); 
        return $diseaseDoctorList;
    }/*}}}*/
    public function ajaxPhotoPost($request, $response) {
        $userid = $request->userid;
        $user = DAL::get()->find('User', $userid);
        $oldImgId = $user->headImage;
        if (isset($_FILES['headimage']) && $_FILES['headimage']['tmp_name'] != '') {
            $imgId = TuClient::getInstance()->uploadImage($_FILES['headimage'], array('original'=>true));

            if ($user->hasConfirmedSpace() && $user->space->isDoctor())
            {
                DoctorClient::getInstance()->modifyByDoctor($user->space->host->id, array('photo' => array('old' => $oldImgId, 'new' => $imgId)));
            }
            if($request->richsite != ''&& null != $request->richsite)
            {
                $this->message('上传成功<br/>为保证您的数据安全,新头像将通过审核方能生效,审核时间为1个工作日', $response, array('forward' => $response->router->urlfor('adminpayment/showrichsite')));
            }
            else
            {
               $this->message('上传成功<br/>为保证您的数据安全,新头像将通过审核方能生效,审核时间为1个工作日', $response, array('forward' => $response->router->urlfor('index/index')));
            }
        }else{
        	$this->message('没有上传头像数据', $response, array('forward' => $response->router->urlfor('index/index')));
        }
    }
 public function edit($request, $response)
 {
     $productADId = $request->id;
     $bindAreas = $request->area;
     $params = array('type' => $request->type, 'isOnLine' => $request->isOnLine, 'beginTime' => strtotime($request->beginTime), 'endTime' => strtotime($request->endTime), 'remark' => trim($request->remark));
     $productAd = DAL::get()->find('ProductAD', $productADId);
     if ($productAd->disease->id != $request->diseaseId || $productAd->doctor->id != $request->doctorId || $productAd->type != $request->type) {
         $id = DoctorClient::getInstance()->checkProductAD($request->diseaseId, $request->doctorId, $request->type);
         if ($id) {
             $msg = "该医生这种情况已经存在!";
             $response->setRedirect('/productad/showaddoredit?id=' . $productADId . '&msg=' . urlencode($msg));
             return;
         }
     }
     $res = DoctorClient::getInstance()->modifyProductAD($productADId, $params, $bindAreas);
     if ($res) {
         $msg = "操作成功了!";
         $response->setRedirect('/productad/showaddoredit?id=' . $productADId . '&msg=' . urlencode($msg));
     } else {
         $msg = "操作失败!";
         $response->setRedirect('/productad/showaddoredit?msg=' . urlencode($msg));
     }
 }
	public function showDetail($request, $response)
	{
		$id = $request->id;
        $id = (int)Codec::getInstance()->decodeId($id);
        if($id == 0)
        {
            exit();
        }
        $page = (int)$request->page;
		$page = ($page > 0) ? $page : 1;
		$pageSize = 20;
		$hospitalFaculty = DAL::get()->find('hospitalfaculty', $id);

        $option['hospitalFaculty'] = $hospitalFaculty->id;
        $option['commentType'] = DoctorComment::COMMENT_TYPE_PROCESS;
        $pageInfo['pageSize'] = 7;
        $latestCommentList = DoctorCommentClient::getInstance()->getCommentList($option, $pageInfo);
		$result = DoctorClient::getInstance()->getPageListByHospitalFaculty($id, $page, $pageSize, $options=array());
		$doctorList = $result['doctorList'];
		$pageInfo = $result['pageInfo'];
		//获得门诊信息
		$ids = array();
		foreach($doctorList as $doctor)
		{
			$ids[] = $doctor->id;
		}
		$tables = DoctorClient::getInstance()->getFormatScheduleList($ids);
		$response->latestCommentList=$latestCommentList['commentList'];
		$response->doctorList=$doctorList;
		$response->tables=$tables;
		$response->hospitalFaculty = $hospitalFaculty;
		
		$router = $response->getRouter();
		$response->pagelink = PageNav::getNavLink(
                PageNav::getPageNavTemplate($router->urlfor('hospitalfaculty/showdetail', array('id'=>$hospitalFaculty->getEncodeId()))."?page="), 
                $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
	}
예제 #20
0
<?php
require 'init.php';
$tmpRequest = new Request();
$tag = $tmpRequest->disease;

if (empty($tag))
	exit;
$doctorList = DoctorClient::getInstance()->getAdDoctor4Search($tag);
if (empty($doctorList))
	exit;
	
foreach ($doctorList as $doctor) {
	$doctors['name'] = $doctor->name;
	$doctors['hurl'] = $doctor->hospitalfaculty->hospital->getUrl();
	$doctors['furl'] = $doctor->hospitalfaculty->getUrl();
	$doctors['durl'] = $doctor->getUrl();
	$doctors['surl'] = $doctor->space->getUrl();
	$doctors['zurl'] = 'http://zixun.haodf.com/ask.php?host_user_id='.$doctor->space->user->id;
	$doctors['special'] = mb_substr($doctor->specialize, 0, 100, 'gbk').'...';
	$doctors['hospital'] = $doctor->hospitalfaculty->hospital->name;
	$doctors['faculty'] = $doctor->hospitalfaculty->name;
	$doctors['grade'] = $doctor->grade;
	$out[$doctor->id] = $doctors; //еепР
}
$out = array_filter($out);
echo serialize($out);
예제 #21
0
    private function doDetailForDoctor($thread) 
    {/*{{{*/
        $thankLetterCount = $this->_newSpace->host->getCureThankLetterCount();
        $doctorVoteResult = DoctorClient::getInstance()->getDoctorGoodVoteDetailByIds(array($this->_newSpace->host->primaryId), 3);
        $doctorVoteResult = array_pop($doctorVoteResult);

        return array($thankLetterCount, $doctorVoteResult);
    }/*}}}*/
    public function getUserInfo4NewIndex($userId)
    {/*{{{*/
        $doctorOwner = DAL::get()->find_by_userid('DoctorOwner', $userId);
        if($doctorOwner->isNull())
        {
            $this->setErrorCode(819);
            return 0;
        }
        $infos = array();
        $infos['userName'] = $doctorOwner->source->user->name;
        $infos['hostName'] = $doctorOwner->source->name;
        $infos['userRole'] = $this->getUserRole($doctorOwner->user);
        $infos['isFollowupOpened'] = 2;
        $infos['headImage'] = ($doctorOwner->isSpace()) ? $doctorOwner->source->getHeadImg4Modify() : $doctorOwner->source->getHeadImage();
        $infos['bigHeadImage'] = ($doctorOwner->isSpace()) ? $doctorOwner->source->getHeadImg4Modify(2400) : $doctorOwner->source->getHeadImage(2400);
        if($doctorOwner->isSpace())
        {
            $space = $doctorOwner->source;
            $infos['spaceId'] = $space->id;
            list($featAmount, $heartImgCnt) = ScoreClient::getInstance()->getHeartInfoById($space->id);
            $infos['featAmount'] = $featAmount;
            $infos['heartImgCnt'] = $this->getFlagCnt($heartImgCnt);
		    $count = count(BookingClient::getInstance()->getOrderList4Doctor($space->id, self::STATUS_TODAY));
            if(false == $space->isBookingOpened())
            {
                $count = 0;
            }
            $infos['bookingCnt'] = $count;
            $telOwner = DAL::get()->find_by_relatedObject('telowner', $space->user);
            $needIllnessCnt = TelOrderClient::getInstance()->queryNeedIllnessTelOrderCnt('TelOrder', $telOwner->id);
            if(!PaymentDataBucket::isOpenPhone($space))
            {
                $needIllnessCnt = 0;
            }
            $infos['needIllnessCnt'] = $needIllnessCnt;
            $waitTimeCnt = TelOrderClient::getInstance()->queryWaitTimeTelOrderCnt('TelOrder', $telOwner->id);
            $waitTelOrderCount = TelOrderClient::getInstance()->getLastNotExeTelOrderCnt($telOwner->id);
            $isShowFreeButton = MainDataBucket::isShowPhoneButton($space, $waitTimeCnt, $waitTelOrderCount);
            $infos['isShowFreeButton'] = $isShowFreeButton;
            $infos['isFollowupOpened'] = ($space->isConfirmed() && false == $space->isOpenFollowup()) ? 0 : 1;
            //患者报道和医生补贴
            $infos['isOpenSubsidy'] = $space->isSignSubsidyOpen()?'1':'0';
            $patientSignForToday = DAL::get()->querySubsidyCntByTimeSpan('SubsidyOrder', $space->id, XDateTime::now()->toShortString());
            $patientSignForMonth = DAL::get()->querySubsidyCntByTimeSpan('SubsidyOrder', $space->id, XDateTime::now()->addDay(-29)->toShortString());
            $subsidyAccountAmount = AccountClient::getInstance()->getSubsidyOrdersAmountInTimespan($space->id, XDateTime::now()->addDay(-29)->toShortString(), XDateTime::now());
            $infos['patientSignForToday'] = $patientSignForToday;
            $infos['patientSignForMonth'] = $patientSignForMonth;
            $infos['subsidyAccountAmount'] = $subsidyAccountAmount;

        }
        $belongDoctors = DoctorClient::getInstance()->getDoctorList4spaceByNoCache($userId);
        if(empty($belongDoctors))
        {
            if ($doctorOwner->isPreDoctor())
            {
                $infos['hospital'][0]['hospitalName']        = $doctorOwner->source->hospitalName;
                $infos['hospital'][0]['hospitalFacultyName'] = $doctorOwner->source->facultyName;
            }
            else
            {
                $this->setErrorCode(840);
                return 0;
            }
        }
        else
        {
            $i = 0;
            foreach($belongDoctors as $doctor){
                $infos['hospital'][$i]['hospitalName']        = $doctor->hospitalfaculty->hospital->name;
                $infos['hospital'][$i]['hospitalFacultyName'] = $doctor->hospitalfaculty->name;
                $i++;
            }
        }
        $this->content = $infos;
    }/*}}}*/
    public function doctorList($request, $response)
    {/*{{{*/
        $currentPage = $request->getRequest('p',1);
        $hospitalId = $request->partnerConfig->hospitalId;
		$response->hospitalId = $hospitalId;
        $hospitalFacultyId = $request->id;
        $this->getFacultyList($request, $response);
        $option = array();
        if (isset($hospitalFacultyId) && false == empty($hospitalFacultyId))
        {
            $hospitalFacultyId  = (int)Codec::getInstance()->decodeId($hospitalFacultyId);
            $option['hospitalFacultyId'] = $hospitalFacultyId;
            $response->hospitalFacultyId = $hospitalFacultyId;
            $hospitalFaculty = DAL::get()->find('hospitalfaculty',$hospitalFacultyId);
            $response->hospitalFacultyName = $hospitalFaculty->name;
        }
        else
        {
            $option['hospitalId'] = $hospitalId;
            $response->hospitalFacultyName = '全部';
        }
        $res = SpaceClient::getInstance()->getCaseOpenDoctor4HzHospital($currentPage, $pageSize = 15, $option);
        $spaceList = $res['spaceList'];
        if (isset($hospitalFacultyId) && false == empty($hospitalFacultyId) && false == empty($res['pageInfo']))
        {
            $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate("/hzhospitalthread/doctorlist/".$request->id.".htm?p=", 2, 5, 1, true, ''),$res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
        }
        elseif(false == empty($res['pageInfo']))
        {
            $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate("/hzhospitalthread/doctorlist.htm?p=", 2, 5, 1, true, ''),$res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
        }
        else
        {
            $response->pageLink = '抱歉,暂无可咨询大夫';
        }
        $response->total = $res['pageInfo']['total'];
        $response->spaceList = $spaceList;
        $doctorIds = array();
        if (false == empty($spaceList))
        {
            foreach($spaceList as $space)
            {
                if($space->isNulL() == false)
                {
                    $doctorIds[] = $space->host->id;
                    $spaceIds[] = $space->id;
                }
            }
            $result = DoctorClient::getInstance()->getAllGoodVoteCount($doctorIds);
            $response->goodVoteCount = $result['goodVoteCount'];
            $tmpResults = SpaceClient::getInstance()->getTmpSpacePostCnt($spaceIds);
        }
        $spacePostCnt = array();
        if (false == empty($tmpResults))
        {
            foreach($tmpResults as $tmpResult)
            {
                $spacePostCnt[$tmpResult['userid']] = $tmpResult['postcount'];
            }
        }
        $response->spacePostCnt = $spacePostCnt;
    }/*}}}*/
예제 #24
0
 public function newIntro($request, $response)
 {
     /*{{{*/
     DBC::requireFalse($this->spaceIsLogin, '不允许自己提交给自己订单!');
     //对没有开通电话咨询医生的链接跳转,没有owner也会跳走.
     if (false == $this->space->isPhoneOpenedForFront($this->user->id)) {
         $response->setRedirect('http://' . URL_PREFIX . '400.haodf.com/index/prompt?doctorName=' . rawurlencode($this->space->host->name) . '&doctorFaculty=' . rawurlencode($this->space->host->hospitalfaculty->faculty->name));
         return;
     }
     $hospitalFacultyDoctorIds = DoctorClient::getInstance()->getHospitalFacultyDoctorLimit3($this->space->host);
     $facultyDoctorIds = DoctorClient::getInstance()->getFacultyDoctorLimit6($this->space->host);
     $facultyDoctorIds = array_diff($facultyDoctorIds, $hospitalFacultyDoctorIds);
     $response->num = count($facultyDoctorIds);
     $facultyDoctorIds = array_slice($facultyDoctorIds, 0, 3);
     $facultyDoctorList = DAL::get()->find('doctor', $facultyDoctorIds);
     $response->facultyDoctorList = $facultyDoctorList;
     $hospitalFacultyDoctorList = DAL::get()->find('doctor', $hospitalFacultyDoctorIds);
     $response->hospitalFacultyDoctorList = $hospitalFacultyDoctorList;
     $response->diseaseList = DiseaseClient::getInstance()->getDiseaseDoctorList(array($this->space->host->primaryId), 50);
     $response->casetotal = PaymentClient::getInstance()->getDoctorVoteCnt($this->space->id);
     $response->satisfactionLists = PaymentClient::getInstance()->getDoctorSatisfactionList($this->space->host->id);
     $serviceCharge = PaymentClient::getInstance()->getServiceChargeList($this->space->id);
     $preg = '#(\\d+.\\d+)(元)#';
     $replace = '<span class="fb orange1">\\1</span>\\2';
     $serviceCharge = preg_replace($preg, $replace, $serviceCharge);
     $response->serviceCharge = $serviceCharge;
     $response->doctor = $this->space->host;
     $owner = DAL::get()->find_by_relatedObjectid_and_relatedobjecttype('telowner', $this->space->id, TelOwner::TYPE_USER);
     $response->doctorWords = $owner->isNull() || $owner->getSpaceExt() == '' ? '' : $owner->getSpaceExt()->getDoctorWords();
     $response->wordLength = $owner->isNull() || $owner->getSpaceExt() == '' ? '' : strlen($owner->getSpaceExt()->getDoctorWords());
     $response->latestOpenCallServiceTitle = doctorOutline::getLatestOpenCallServiceTitle($owner->spaceExt->starttime4tel->toString());
     $response->owner = $owner;
     $goodCnt = PaymentClient::getInstance()->getPatientPhoneServiceCountByScore($this->space->id, TelVisit::SCORE_GOOD);
     $normalCnt = PaymentClient::getInstance()->getPatientPhoneServiceCountByScore($this->space->id, TelVisit::SCORE_SOSO);
     $badCnt = PaymentClient::getInstance()->getPatientPhoneServiceCountByScore($this->space->id, TelVisit::SCORE_BAD);
     $allCnt = $goodCnt + $normalCnt + $badCnt;
     $response->allCnt = $allCnt;
     $response->goodCnt = $allCnt > 0 ? floor($goodCnt / $allCnt * 100) : 0;
     $response->normalCnt = $allCnt > 0 ? ceil($normalCnt / $allCnt * 100) : 0;
     $response->badCnt = $response->goodCnt + $response->normalCnt != 0 ? 100 - $response->goodCnt - $response->normalCnt : 0;
     // 常见问题
     $response->commonQuestions = $owner->isNull() || $owner->getSpaceExt() == '' ? '' : $owner->getSpaceExt()->commonquestions;
     $options['status'] = array(TelOrder::STATUS_FINISHED, TelOrder::STATUS_CLOSED);
     $response->telOrderCount = TelOrderClient::getInstance()->getOrderCount4Space($this->space->id, $options);
     $response->productList = ProductClient::getInstance()->getProducts($this->space, array(serviceDef::TYPE_TELORDER));
 }
예제 #25
0
	public function xinZang($request, $response)
	{/*{{{*/
		$hospitalFacultyIds = $this->getXinZangHospitalFacultyId();
		$allHospitalFacultyIds = $this->getAllHospitalFacultyIds();
		$allHospitalFaculty = DAL::get()->find('hospitalfaculty', $allHospitalFacultyIds);
		$openBookingCount = PlussignChannelClient::getInstance()->getBookingCount($allHospitalFacultyIds);
		//=====右边=====心血管疾病 看病指南
		$xinZangTags = DAL::get()->find_by_keyword('cmstag', 'xinzang');
		$xinZangCount = array();
		$tagCount = array();
		if(empty($xinZangTags) == false)
		{
			foreach($xinZangTags->children as $tags)
			{
				foreach($tags->children as $tag)
				{
					$tagCount[$tag->name] = count($tag->cmstaglinkref);
				}
				$xinZangCount[$tags->name] = array_sum($tagCount);
			}
		}
		$facultyName = array('心血管内科', '心血管外科', '小儿心内科', '小儿心外科');
		$openCaseDoctorCount = DoctorClient::getInstance()->getOpenCaseDoctorCount();
		$openBookingDoctorCount = BookingClient::getInstance()->getOpenBookingDoctorCount('', $facultyName);
		$successBookingOrderTotalCount = BookingClient::getInstance()->getSuccessBookingOrderCount();
		//取符合条件的医生spaceId
		$spaceIdList = PlussignChannelClient::getInstance()->getXinZangBookingSpaceIds();
		//随机取8个
		shuffle($spaceIdList); 
		$spaceIds = array_slice($spaceIdList, 0, 8);
		$spaces = array();
		$successBookingCount = 0;
		if(empty($spaceIds) == false){
			$spaces = DAL::get()->find('space', $spaceIds);
			//一个医生的加号成功条数
			$successBookingCount = PlussignChannelClient::getInstance()->getXinZangBookingCount($spaceIds);
		}
		
	    $response->hospitalFacultyIds = $hospitalFacultyIds;
	    $response->allHospitalFacultyIds = $allHospitalFacultyIds;
	    $response->allHospitalFaculty = $allHospitalFaculty;
	    $response->openBookingCount = $openBookingCount;
	    $response->xinZangCount = $xinZangCount;
	    $response->openCaseDoctorCount = $openCaseDoctorCount;
	    $response->openBookingDoctorCount = $openBookingDoctorCount;
	    $response->successBookingOrderTotalCount = $successBookingOrderTotalCount;
	    $response->spaces = $spaces;
	    $response->successBookingCount = $successBookingCount;
	    $response->type = 'xinzang'; //返回页面类型,暂时用于控制二级导航
	}/*}}}*/
                <th>任务级别</th>
                <th>分配时间</th>
                <th>状态</th>
        </tr>
            
<?php 
$doctorIds = array();
$spaceIds = array();
foreach ($searchIndex as $index) {
    $task = DAL::get()->find('hospitalcontactdoctortask', $index->id);
    $doctorIds[] = $task->source->id;
    $spaceIds[] = $task->source->space->id;
}
$scheduleInfos = array();
if (false == empty($doctorIds)) {
    $scheduleResults = DoctorClient::getInstance()->getFormatScheduleList($doctorIds);
    foreach ($scheduleResults as $doctorId => $doctorSchedule) {
        $scheduleStr = '';
        foreach ($doctorSchedule as $key1 => $daySchedule) {
            if ($key1 == 'isMoreSite') {
                continue;
            }
            foreach ($daySchedule as $key2 => $schedule) {
                if (isset($schedule['type'])) {
                    if ($schedule['type'] == '特需') {
                        $scheduleStr .= $key1 . '特' . getHourStr($key2);
                    } else {
                        $scheduleStr .= $key1 . getHourStr($key2);
                    }
                }
            }
예제 #27
0
 private function _searchDoctor0($result, $confirm, $key, $nowPage, $t, $type, $url, $frame)
 {
     $targetdesc = "医生";
     $pageLink = '';
     if ($confirm) {
         $result = DoctorClient::getInstance()->searchDoctors0($key, $nowPage, 50);
         $pageLink = self::_pageInfo($result, $confirm, $key, $nowPage, $t, $type, $url, $frame);
     }
     return array($targetdesc, $result, $pageLink);
 }
예제 #28
0
    public function ajaxOrderDiseaseInfo($request, $response)
    {/*{{{*/
        $orderId = $request->orderid; 
        $order = DAL::get()->find('telorder', $orderId);
        if($order->isNull())
        {
			die('无效的订单ID');
        }
        $response->order = $order;
        $doctorUser = DAL::get()->find('user', $order->executer->relatedObject->id);
        $doctorId = $doctorUser->space->host->id;
        $diseasesOfDoctor = DoctorClient::getInstance()->getDiseasesOfDoctor($doctorId); 
        $response->diseasesOfDoctor = $diseasesOfDoctor;
		$diseaseList = array();
        $diseaseName =  XString::convertCharacterSet($request->diseasename, 'gbk');
        if(false == empty($diseaseName))
        {
            $diseaseList = DAL::get()->find_all_similarDiseaseLimitName('disease', $diseaseName, array('isVoteSelf' => array(1)));
        }
        $response->diseaseList = $diseaseList;
        $response->diseaseName = $request->diseaseName;
        //取当前订单医生已审核订单绑定的疾病 wk
        $bindsOrders = PaymentClient::getInstance()->getBindsOrdersOfDoctor('telorder', $order->executerid, array(TelOrder::STATUS_CONFIRM, TelOrder::STATUS_FINISHED, TelOrder::STATUS_CLOSED));
        $allDiseaseIdsOfConfirmOrder = array();
        foreach($bindsOrders as $result)
        {
            if(empty($result['diseaseid'])) continue;
            $allDiseaseIdsOfConfirmOrder[] = $result['diseaseid'];
        }
        $diseasesOfConfirmOrder = DAL::get()->find('disease', $allDiseaseIdsOfConfirmOrder);
        foreach($diseasesOfConfirmOrder as $disease)
        {
            if(Disease::ISVOTESELF_NO == $disease->isVoteSelf)
            {
                unset($diseasesOfConfirmOrder[$disease->id]);
            }
        }
        //当前订单咨询的大夫的所有投票疾病 wk
        $response->diseases = $diseasesOfConfirmOrder;
    }/*}}}*/
예제 #29
0
 public function searchOne($request, $response)
 {
     /*{{{*/
     $doAction = $request->doAction;
     $diseaseList = array();
     if ($request->content && ($doAction == 'disease' || $doAction == 'diseaseList')) {
         $diseaseList = DiseaseClient::getInstance()->getDiseaseForSearch($request->content, 50);
         $response->resultList = $diseaseList;
     }
     if (($doAction == 'doctor' or $doAction == 'doctorinfo') && $request->content) {
         $doctorList = DoctorClient::getInstance()->getDoctorListByDoctorUserName($request->content);
         //首先按用户名找,找不到再按医生姓名找
         if (count($doctorList) < 1) {
             $doctorList = DoctorClient::getInstance()->getDoctorForSearch($request->content, 100);
         }
         $response->resultList = $doctorList;
     }
     $response->doAction = $request->doAction;
     $response->content = $request->content;
 }
		$doctorId = $doctor->id;
		$hospitalId = $doctor->hospitalfaculty->hospital->id;
		$province = $doctor->hospitalfaculty->hospital->province;
		$diseaseKey = ($MainDisease->parentKey) ? $MainDisease->parentKey : $MainDisease->key;
		$notInDoctorIds = $onlineDoctorIds;
		$notInDoctorIds[] = $doctorId;
		//同医院同疾病在线医生
		$options = array();
		$options['hospitalId'] = $hospitalId;
		$diseaseDoctorList = DoctorClient::getInstance()->getDoctorList4SameDisease($notInDoctorIds, $diseaseKey, $options, $onlineDoctorlimit);
		if(empty($diseaseDoctorList))
		{
			//同地区同疾病在线医生
			$options = array();
			$options['province'] = $province;
			$diseaseDoctorList = DoctorClient::getInstance()->getDoctorList4SameDisease($notInDoctorIds, $diseaseKey, $options, $onlineDoctorlimit);
		}
		if(empty($diseaseDoctorList) == false)
		{
			foreach($diseaseDoctorList as $diseaseDoctor)
			{
				$diseaseDspDoctorList[] = $diseaseDoctor;
				$onlineDoctorIds[] = $diseaseDoctor->primaryId;
			}
		}
	}
	if(count($diseaseDspDoctorList) > 0)
	{
		$diseaseOnLineDoctorInfos[$index]['MainDisease'] = $MainDisease;
		$diseaseOnLineDoctorInfos[$index]['diseaseDspDoctorList'] = $diseaseDspDoctorList;
	}