private function getRealData(Hospital $hospital) {/*{{{*/ $hospitalList = array(); $isPlus = PlussignChannelClient::getInstance()->isHospitalBookDoctor($hospital->commonName); $res['url'] = $hospital->getUrl(); $res['name'] = $hospital->commonName; $res['address'] = ($hospital->address)?$hospital->address:"暂无"; $res['phone'] = ($hospital->address)?$hospital->phone:"暂无"; $res['pageSize'] = rand(60, 66).'K'; $res['date'] = date('Y-m-d', time()); $res['mapUrl'] = $hospital->getReMapUrl(); $res['scheduleUrl'] = $hospital->getScheduleUrl(); if($isPlus) { $res['extTitle'] = "预约加号"; $res['extUrl'] = 'http://jiahao.haodf.com/jiahao/search.htm?district='.urlencode($hospital->city).'&hospitalName='.urlencode($hospital->commonName); } else { $res['extTitle'] = "大夫文章"; $res['extUrl'] = $hospital->getArticleUrl(); } $res['doctorUrl'] = $hospital->getDoctorUrl(); $res['infoUrl'] = $hospital->getInfoUrl(); $hospitalList['item'] = $res + $this->getAlias($hospital); BeanFinder::get('LocalCache')->removeAll(); return $hospitalList; }/*}}}*/
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; }/*}}}*/
public function index($request, $response) {/*{{{*/ $this->initialize($request, $response); $response->btn = 'faculty'; $response->topTitle = $this->hospital->commonName; $response->title = "{$this->hospital->commonName}_科室列表,门诊时间,专家推荐_好大夫在线"; if ($this->hospital->doctorCount > 2) { $response->title = "{$this->hospital->commonName}_科室列表,咨询{$this->hospital->commonName} {$this->hospital->spaceCount}位大夫_好大夫在线"; } $response->hospitalFacultyList = $this->hospital->getHospitalFacultyList(HospitalFaculty::IS_SELECT_FACULTY_BY_VOTE_NO); $isPlus = PlussignChannelClient::getInstance()->isHospitalBookDoctor($this->hospital->commonName); $facultyList = array(); if ($isPlus) { $facultyList = PlussignChannelClient::getInstance()->getFacultyListByCondition('', $isPlus[0], $this->hospital->commonName); } $response->facultyList = $facultyList; $this->showAliPayPath($request, $response); }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $hospitalList = HospitalClient::getInstance()->getHasArticleHospitalList($nowPage, $pageSize); $hospitals = array(); $excludeHospitalIds = BeanFinder::get('configs')->excludeHospitalIds; foreach ($hospitalList as $hospital) { if(in_array($hospital->id, $excludeHospitalIds)) { continue; } $isPlus = PlussignChannelClient::getInstance()->isHospitalBookDoctor($hospital->commonName); if (false == $isPlus) { $hospitalNames = $this->getAllNames($hospital); if (count($hospitalNames)>1) { foreach ($hospitalNames as $key => $hospitalName) { $hospitals[] = array('item' => $this->getRealData($hospital, $hospitalName)); unset($hospitalName); } } else { $hospitals[] = array('item' => $this->getRealData($hospital, '')); } } unset($hospital); BeanFinder::get('LocalCache')->removeAll(); } BeanFinder::get('LocalCache')->removeAll(); return $hospitals; }/*}}}*/
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); }/*}}}*/
public function search($request, $response) {/*{{{*/ $hezuoHospitalId = $request->getRequest('hezuoHospitalId', ''); $hezuoFacultyName = $request->getRequest('hezuoFacultyName', ''); $nowPage = $request->getRequest("page",1); $pageSize = 20; $enDistrictKey = $request->getRequest('district','beijing'); if ($enDistrictKey == 'hezuo'){ //Context::jump("http://".URL_PREFIX."jiahao.haodf.com/hospital/hezuo/1.htm", false); $this->heZuo($request, $response); } $provList = Area::provInfo4PlussignChannel(); $enDistrict = isset($provList[$enDistrictKey]) ? $provList[$enDistrictKey]['Name'] : $request->getRequest('district','北京'); $enHospitalId = Codec::getInstance()->decodeId($request->getRequest('hospitalId', '')); $enHospitalName = $request->getRequest('hospitalName',''); if ($hezuoHospitalId){ $plussignChannel = DAL::get()->find_by_hospitalid('PlussignChannel', $hezuoHospitalId ); if ($plussignChannel->isNull() == false){ $enHospitalName = $plussignChannel->hospitalName; } } if ($enHospitalId){ $plussignChannel = DAL::get()->find_by_hospitalid('PlussignChannel', $enHospitalId ); if ($plussignChannel->isNull() == false){ $enHospitalName = $plussignChannel->hospitalName; } } $enFacultyName = $request->getRequest('facultyName',''); $enFacultyId = $request->getRequest('facultyId',''); if (false == empty($enFacultyId)) { $enFaculty = DAL::get()->find('faculty', $enFacultyId); $enFacultyName = $enFaculty->name; } $facultyKey = $request->getRequest('facultyKey',''); if (false == empty($facultyKey)) { $enFacultyList = FacultyList::getMainFacultyList(); if (isset($enFacultyList[$facultyKey])) $enFacultyName = $enFacultyList[$facultyKey]; } if ($hezuoFacultyName){ $enFacultyName = $hezuoFacultyName; } $district= rawurldecode ($enDistrict); $hospitalName = rawurldecode ($enHospitalName); $facultyName = rawurldecode ($enFacultyName); $out = PlussignChannelClient::getInstance()->getAll(); if($district =='北京'||$district =='上海'||$district =='广东') { $showBSG = $this->showHosptial($out[$district]['hospital'],$district); $response->showBSG = $showBSG; } $facultyArr = FacultyList::getList(); $facultyNameList = isset($facultyArr[$facultyName]) ? $facultyArr[$facultyName]:array($facultyName); $doctorCount = PlussignChannelClient::getInstance()->getDoctorCountByCondition($district,$hospitalName,$facultyNameList); $facultyList = PlussignChannelClient::getInstance()->getFacultyListByCondition($out,$district,$hospitalName); if ($hezuoHospitalId){ $sets = PlussignChannelClient::getInstance()->pagingWithSpace($nowPage,$pageSize,$district,$hospitalName,$facultyName, $hezuoHospitalId, $hezuoFacultyName,$enHospitalId, $facultyKey, $enFacultyId); } else { $sets = PlussignChannelClient::getInstance()->pagingWithSpace($nowPage,$pageSize,$district,$hospitalName,$facultyName, '' , '', $enHospitalId, $facultyKey, $enFacultyId); } $spaceIds = $sets['spaceIds']; $successOrderCount = PlussignChannelClient::getInstance()->getOrderCntOfSpaces($spaceIds); $response->urlDistrict = $district; $response->urlHospitalName = $hospitalName; $response->urlFacultyName = $facultyName; $response->urlHospitalId = $enHospitalId; $response->doctorCount = $doctorCount; $response->districtList = $out; $response->facultyArr = $facultyArr; $response->facultyList = $facultyList; $response->spaces = DAL::get()->find('Space', $spaceIds); $response->requirements = $sets['requirements']; $response->appointTime = $sets["appointTime"]; $response->pageLink = $sets["pageLink"]; $response->successOrderCount = $successOrderCount; $response->type = 'search'; //返回页面类型,暂时用于控制二级导航 //SEO $title = $hospitalName.$facultyName."转诊预约_".$district."_向专家本人申请转诊机会"; if (empty($hospitalName) && empty($facultyName)) { $title = $district."向专家本人申请转诊机会"; } $response->title = $title; }/*}}}*/
private function getJiahaoHospitalFacultyDoctor($hospitalFaculty, $nowPage, $pageSize) {/*{{{*/ list($spaceIds, $pageInfo) = PlussignChannelClient::getInstance()->getSpaceIdsByCondition( $nowPage, $pageSize, $hospitalFaculty->hospital->province, $hospitalFaculty->hospital->name, array($hospitalFaculty->faculty->name) ); $spaces = DAL::get()->find('Space', $spaceIds); $doctorList = array(); foreach($spaces as $space) { $doctorList[] = $space->host; } return array('pageInfo'=>$pageInfo, 'doctorList'=>$doctorList); }/*}}}*/
private function detailWithSpace($request, $response, Doctor $doctor) {/*{{{*/ $response->newUser = $doctor->space->user; $response->scheduleWeek = ScheduleClient::getInstance()->getScheduleWeek($doctor->space->id); //最新文章 $articleList = array(); $articleCount = 0; if ($doctor->space->isOpened()) { $articleList = ArticleClient::getInstance()->getList($doctor->space->id, '', 0, 5, array('orderby'=>'fld_ArticleUpdateTime desc')); $articleCount = ArticleClient::getInstance()->getStickArticle($doctor->space->id, 0); } $response->articleList = isset($articleList['articleList']) ? $articleList['articleList'] : array() ; $response->articleCount = $articleCount; //最新回复 $doctorPatientRefs = array(); if ($doctor->space->isOpened() && $doctor->space->isCaseAndNewCaseOpen()) { $doctorPatientRefs = DAL::get()->find_all_lastpost_by_space('doctorpatientref', $doctor->space, 5); } $response->doctorPatientRefs = $doctorPatientRefs; $spaceAskedThreadsCount = SpaceClient::getInstance()->getCountOfAskedThreadsCount($doctor->space->id, $this->curUser->id); $spaceAskedFlowsCount = SpaceClient::getInstance()->getCountOfAskedFlowsCount($doctor->space->id, $this->curUser->id); $spaceRepliedThreadsCount = SpaceClient::getInstance()->getCountOfRepliedThreadsCount($doctor->space->id, $this->curUser->id); $spaceRepliedFlowsCount = SpaceClient::getInstance()->getCountOfRepliedFlowsCount($doctor->space->id, $this->curUser->id); $response->spaceAskedCount = $spaceAskedThreadsCount + $spaceAskedFlowsCount; $response->spaceRepliedCount = $spaceRepliedThreadsCount + $spaceRepliedFlowsCount; //最新在线时间 $activityTimeInfo = SpaceClient::getInstance()->getActivityTime('space', array($doctor->space->id)); $activityTime = isset($activityTimeInfo[$doctor->space->id]) ? $activityTimeInfo[$doctor->space->id] : 0; $response->activityTime = $activityTime; $owner = DAL::get()->find_by_relatedobjectid_and_relatedobjecttype('TelOwner', $doctor->space->user->id, 'User'); $response->productList = ProductClient::getInstance()->getProducts($doctor->space, array(ServiceDef::TYPE_TELORDER)); $response->owner = $owner; $response->presentCnt = PresentClient::getInstance()->getCntOfPresent($doctor->space->id); //加号 $isBooking = $doctor->space->isBookingOpened(); $contract = $spaceBusinessRequirement = array(); $successOrderCount = 0; if($isBooking) { $contract = $doctor->space->getBookingContract(); $spaceBusinessRequirement = $doctor->space->getSpaceBusinessRequirement4Booking(); //在该医生处成功加号数量 if($contract->isNull() == false) $successOrderCount = PlussignChannelClient::getInstance()->getOrderCount(array($contract->id)); } $response->isBooking = $isBooking; $response->spaceBusinessRequirement = $spaceBusinessRequirement; $response->successOrderCount = $successOrderCount; $response->telVisitInfos = array(); //电话 if ($doctor->space->isPhoneOpenedForFront()) { $telVisitList = PaymentClient::getInstance()->getPatientPhoneServiceList($doctor->space->user->id, 1, 10); $response->telVisitTotalCnt = isset($telVisitList['pageInfo']['total']) ? $telVisitList['pageInfo']['total'] : 0; $telVisitInfos = DAL::get()->queryLatestCompleteOrderIdsBySpaceId('TelOrder', $doctor->space->user->id, $count = 10); $response->telVisitInfos = $telVisitInfos; $response->ScoreDesc = TelVisit::$scoreDesc; $response->callingLogs = PaymentClient::getInstance()->getDoctorRecentPhoneRecords($doctor->space); } $response->ref = DAL::get()->find_by_userid_and_spaceid('DoctorPatientRef', $this->curUser->id, $doctor->space->id); $this->hasOnlyPatientFlow($request, $response, $doctor); }/*}}}*/
$scheduleStr .= $key1 . '特' . getHourStr($key2); } else { $scheduleStr .= $key1 . getHourStr($key2); } } } } $scheduleInfos[$doctorId] = $scheduleStr; } } $telOrderInfo = array(); $bookingOrderInfo = array(); $articleInfo = array(); if (false == empty($spaceIds)) { $telOrderInfo = TelOrderClient::getInstance()->getFinishedAndClosedOrderCnt('telorder', $spaceIds); $bookingOrderInfo = PlussignChannelClient::getInstance()->getOrderCntOfSpaces($spaceIds); $articleInfo = DAL::get()->queryValidArticleCnt('article', $spaceIds); } foreach ($searchIndex as $index) { $task = DAL::get()->find('hospitalcontactdoctortask', $index->id); $openService = ''; $articleCount = '无文章'; if (false == $task->source->space->isNull()) { $space = $task->source->space; $showCaseMsg = ''; if (false == $task->source->space->isAsk()) { $showCaseMsg = '未开通'; } else { $showCaseMsg = '开通'; } /*$flowInfos = FlowClient::getInstance()->getSpaceReplyCountBySpaceIds(array($task->source->space->id));
public function getDoctorList4JiaHao($districtKey, $enHospitalId, $hosFacultyKey, $facultyId, $pageId, $pageSize) {/*{{{*/ $this->_initPageInfo($pageId, $pageSize); $district = empty($districtKey) ? '北京' : $districtKey; $enHospitalName = ''; if ($enHospitalId){ $plussignChannel = DAL::get()->find_by_hospitalid('PlussignChannel', $enHospitalId ); if ($plussignChannel->isNull() == false){ $enHospitalName = $plussignChannel->hospitalName; }else { $this->setErrorCode('128'); return 0; } } $facultyName = ''; if (false == empty($hosFacultyKey)) { $enFacultyList = FacultyList::getMainFacultyList(); if (isset($enFacultyList[$hosFacultyKey])) { $facultyName = $enFacultyList[$hosFacultyKey]; }else { $this->setErrorCode('134'); return 0; } } if (false == empty($facultyId)) { $enFaculty = DAL::get()->find('faculty', $facultyId); if($enFaculty->isNull()) { $this->setErrorCode('130'); return 0; } $facultyName = $enFaculty->name; } $facultyArr = FacultyList::getList(); $facultyNameList = isset($facultyArr[$facultyName]) ? $facultyArr[$facultyName]:array($facultyName); $result = PlussignChannelClient::getInstance()->pagingWithSpace($pageId, $pageSize, $district, $enHospitalName, $facultyName, '' , '', $enHospitalId, $hosFacultyKey, $facultyId); $spaces = DAL::get()->find('Space', $result['spaceIds']); $infos = array(); $successOrderCounts = PlussignChannelClient::getInstance()->getOrderCntOfSpaces($result['spaceIds']); foreach($spaces as $spaceId => $space) { if($space->host instanceof Doctor && false == $space->host->hospitalfaculty->hospital->isInnerTestHospital()) { $info = array(); $info['doctorId'] = $space->host->id; $info['doctorName'] = $space->name; $info['doctorImgUrl'] = $space->host->getHeadImageForMobile(); $info['grade'] = $space->host->grade; $info['educateGrade'] = $space->host->educateGrade; $info['hospitalCommonName'] = $space->host->hospitalfaculty->hospital->commonName; $info['hospitalFacultyName'] = $space->host->hospitalfaculty->name; $info['jiaHaoDisease'] = $result['requirements'][$spaceId]->disease; $info['jiaHaoTime'] = trim($result['appointTime'][$spaceId]); $info['successOrderCount'] = isset($successOrderCounts[$spaceId]) ? $successOrderCounts[$spaceId] : 0; $infos[] = $info; } } $this->pageInfo = $result['pageInfo']; $this->content = $infos; }/*}}}*/
private function getBookingInfo($diseaseFaculty, $response) {/*{{{*/ $faculty = $diseaseFaculty->faculty; $response->faculty = $faculty; $phoneDoctorIds = DAL::get()->queryDoctorIdsByFaculty('DoctorOutLine', $faculty->id, 3); $phoneServices = $topPhoneDoctor = array(); if (false == empty($phoneDoctorIds)) { $topPhoneDoctor = DAL::get()->find('Doctor', $phoneDoctorIds); $phoneServices = PaymentClient::getInstance()->getDoctorSatisfactionList($phoneDoctorIds); } $phoneDoctorCount = DoctorClient::getInstance()->getIsPhoneServiceOpenedDoctorCount($faculty); $response->topPhoneDoctor = $topPhoneDoctor; $servicePayInfo = array(); foreach($phoneServices as $phoneService) { // 解决 ARK-7955 $servicePayInfo[] = $phoneService; } $response->phoneServices = $servicePayInfo; $response->phoneDoctorCount = $phoneDoctorCount; $faculty = $diseaseFaculty->faculty; //预约加号 $spaceIds = PlussignChannelClient::getInstance()->getDoctorListByFaculty($faculty); $successOrderCount = PlussignChannelClient::getInstance()->getOrderCntOfSpaces($spaceIds); $bookingContractCount = BookingClient::getInstance()->getDoctorTotalCountByFaculty('bookingorder', $faculty); $response->bookingSpaces = DAL::get()->find('Space', $spaceIds); $response->successOrderCount = $successOrderCount; $response->bookingContractCount = $bookingContractCount; }/*}}}*/
public function loadMoreBookingDoctor($request, $response) {/*{{{*/ $this->initialize($request, $response); $nowPage = $request->getRequest('p', 1); $facultyId = $this->hospitalFaculty->faculty->id; $facultyName = $this->hospitalFaculty->faculty->name; $hospitalName = $this->hospitalFaculty->hospital->commonName; $hospitalId = $this->hospitalFaculty->hospital->id; $district = $this->hospitalFaculty->hospital->province; if ($hospitalId){ $plussignChannel = DAL::get()->find_by_hospitalid('PlussignChannel', $hospitalId ); if ($plussignChannel->isNull() == false){ $hospitalName = $plussignChannel->hospitalName; } } $sets = PlussignChannelClient::getInstance()->pagingWithSpace($nowPage,self::PAGESIZE_DOCTOR, $district, $hospitalName, $facultyName, '' , '', $hospitalId, '', $facultyId); $spaceIds = $sets['spaceIds']; $response->spaces = DAL::get()->find('Space', $spaceIds); $response->nowPage = $nowPage; $response->pages = $sets['pageInfo']['pages']; $response->totalDoctorCnt = $sets['pageInfo']['total']; $response->loadUrl = $response->touchUrl.'/hospitalfaculty/loadmorebookingdoctor?id='.$request->id.'&p='; }/*}}}*/
?> <tr> <td class="tdl">科室网站:</td> <td class="tdr_b"><a href="http://<?=$space->user->name?>.haodf.com">http://<?=$space->user->name?>.haodf.com</a></td> </tr> <?php } ?> <?php if ($hospitalFaculty->phone) { ?> <tr> <td class="tdl">科室电话:</td> <td class="tdr_b"><?=$hospitalFaculty->phone?></td> </tr> <?php } if($openBookingCount>0){ //主要是用这个Hospital页的方法拿到地址district $isPlus = PlussignChannelClient::getInstance()->isHospitalBookDoctor($hospitalFaculty->hospital->commonName); ?> <tr> <td class="tdl">转诊预约:</td> <td> <div class="clearfix"> <span class="fl">本科室开通转诊服务的大夫<span class="orange" style="margin-bottom:5px;"><?=$openBookingCount?></span>名</span> <a href="http://<?=URL_PREFIX?>jiahao.haodf.com/<?=rawurlencode(Area::getProvKeyByName4PlussignChannel($hospitalFaculty->hospital->province))?>/hospitalfaculty/<?=rawurlencode($hospitalFaculty->hospital->id)?>/<?=rawurlencode($hospitalFaculty->faculty->id)?>.htm" class="fl jiahao_btn ml10" target="_blank"> <span class="jiahao_btn_l"> <span class="jiahao_btn_r"> <span class="jiahao_icon_refer">本科室开通转诊服务的大夫</span> </span> </span> </a> </div>
public function getFinishedBookingOrderList($pageId, $pageSize) {/*{{{*/ $this->_initPageInfo($pageId, $pageSize); $bookingContractId = 0; $wapget = 1; $out = PlussignChannelClient::getInstance()->getBookingOrders($bookingContractId, $pageId, $pageSize, $wapget); $orders = $out['bookingOrder']; $pageInfo = $out['pageInfo']; $infos = array(); $bookingCnts = $this->_getBookingCounts($orders); foreach($orders as $order) { $info = array(); $info['orderId'] = $order->id; $helper = BingLiDtoHelper::create($order->getBingLiSource()); $info['disease'] = $helper->getDiseasesStr(); $info['description'] = XString::htmlspecialchars_decode($helper->getLastConditionDesc()); $info['ctime'] = substr($order->ctime, 0, 16); $info['bookingTime'] = substr($order->schedule, 0, 16); $info['orderStatusMsg'] = $order->getOrderStatusMsg(); $info['statusTime'] = substr($order->schedule, 0, 16); foreach($bookingCnts as $bookingCnt) { if($bookingCnt['spaceid'] == $order->space->id) { $info['finishBookingCnt'] = $bookingCnt['cnt']; } } $space = $order->space; $doctorInfo = $this->_getDoctorInfo($space); $info = array_merge($info,$doctorInfo); $infos[] = $info; } $this->pageInfo = $pageInfo; $this->content = $infos; }/*}}}*/
$flowInfo = array_shift($flowInfos); $flowCount = empty($flowInfo['cnt']) ? 0 : $flowInfo['cnt']; $openService .= "网上咨询({$showCaseMsg}" . "{$flowCount})   "; $showPhoneMsg = ''; if (false == $task->source->space->isPhoneOpenedForFront()) { $showPhoneMsg = '未开通/'; } $options['status'] = array(TelOrder::STATUS_FINISHED, TelOrder::STATUS_CLOSED); $telOrderCount = TelOrderClient::getInstance()->getOrderCount4Space($task->source->space->id, $options); $openService .= "电话咨询({$showPhoneMsg}" . "{$telOrderCount})   "; $showBookMsg = ''; $spaceBusiness = DAL::get()->find_by_spaceid('spacebusinessrequirement', $task->source->space->id); if (false == $spaceBusiness->isBookingActuallyOpened()) { $showBookMsg = '未开通/'; } $bookingOrderInfo = PlussignChannelClient::getInstance()->getOrderCntOfSpaces(array($task->source->space->id)); $bookingOrderCount = $bookingOrderInfo[$task->source->space->id]; $openService .= "加号({$showBookMsg}" . "{$bookingOrderCount})   "; } ?> <td><span class="fl pl10"><?php 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>
public function orderFormList($request, $response) {/*{{{*/ if (false == $this->isFromNotice()) { $next = $this->_newSpace->getUrl(); if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) { $next = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; } $refer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $this->_newSpace->getUrl(); $response->setRedirect('http://'.URL_PREFIX.'jiahao.haodf.com/notice.htm?refer='.urlencode($refer).'&next='.urlencode($next)); return parent::DIRECT_OUTPUT; } $this->forceSpaceModuleCheck('PlusSign', $response); if(false == $this->_newSpace->isBookingOpened()){ $this->message('目前医生关闭了预约加号服务!', $response, array('forward'=>"http://{$this->_newSpace->userName}.haodf.com")); return false; } $schedulelist = $this->_newSpace->getSpaceBusinessRequirement4Booking()->serializedSchedule; //约满 $seatLimits = BookingClient::getInstance()->getseatLimitCount( $this->_newSpace, date('Y-m-d', strtotime("+ 3 day")), date('Y-m-d', strtotime("+ 17 day"))); $contract = $this->_newSpace->getBookingContract(); //停诊 $stopDiagnose = DAL::get()->find_all_by_spaceid('StopDiagnose', $this->_newSpace->id); //预告 $notices = BookingClient::getInstance()->getSchedule($contract->id); $orderList = BookingClient::getInstance()->getOrderList($this->_newSpace->user->id); $response->bookingOrderCount = PlussignChannelClient::getInstance()->getOrderCount(array($contract->id)); $response->spaceBusinessRequirement = $this->_newSpace->getSpaceBusinessRequirement4Booking(); $response->schedulelist = $schedulelist; $response->userObject = $this->_newUser; $response->stopDiagnose = $stopDiagnose; $response->seatLimits = $seatLimits; $response->orderList = $orderList; $response->space = $this->_newSpace; $response->notices = $notices; $response->title = $this->_newSpace->host->hospitalfaculty->hospital->commonName.$this->_newSpace->name.'大夫转诊预约'; }/*}}}*/
<div class="panelB_blue"> <div class="toptr"> <div class="lt"> <ul> <li class="current_item"><a href="<?=$hospital->getUrl()?>"><?=$hospital->commonName?></a><span>科室列表</span></li> </ul> </div> <span style="float:right; padding:15px 20px 0px 0px; color:#FFFFFF;">(科室 <?=$hospital->facultyCount?> 个, 大夫 <?=$hospital->doctorCount?> 人)</span> <div class="cls"></div> </div> <div class="midtr"> <div class="lt"> <?php $facultyList = array(); if($isPlus) $facultyList = PlussignChannelClient::getInstance()->getFacultyListByCondition('', $isPlus[0], $hospital->commonName); ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="hosbra"> <?php $z=0; foreach($hospitalFacultyList as $key1=>$value1) { $i=$j=0; ?> <tr> <td width="12%" class="font14"><?=$key1?></td> <td><table width="100%" border="0" cellspacing="0" cellpadding="0" id="hosbra"> <tr> <?php $i=0; foreach($value1 as $faculty) { ?> <?php if($i!=0&&$i%2==0) { ?> </tr> <tr> <?php } ?> <td width="50%"> <?php $threadtempurl = "/faculty/".$faculty->getEncodeId()."/daifu.htm"?> <a href="<?=$faculty->getUrl()?>" target="_blank" class="blue"><?=$faculty->name?></a>
public function getProvinceList4JiaHao() {/*{{{*/ $resultList= PlussignChannelClient::getInstance()->getAll(); $infos = array(); foreach($resultList as $provinceName => $hospitals) {/*{{{*/ $info = array(); if($provinceName == '其它地区' || $provinceName == '北京' || $provinceName == '上海' || $provinceName == '广东') { continue; } $info['provinceName'] = $provinceName; $infos[] = $info; }/*}}}*/ $mergeInfos = array(array('provinceName'=>'北京'),array('provinceName'=>'上海'),array('provinceName'=>'广东')); $infos = array_merge($mergeInfos, $infos); $this->content = $infos; }/*}}}*/
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 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; }
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'; //返回页面类型,暂时用于控制二级导航 }/*}}}*/
private function getBookingCount($request, $response) { /*{{{*/ $response->bookingOrderCount = PlussignChannelClient::getInstance()->getOrderCount(array($this->space->getBookingContract()->id)); if ($this->isSpaceLogin()) { $orderList1 = BookingClient::getInstance()->getOrderList4Doctor($this->space->user->id, 'pending'); $orderList2 = BookingClient::getInstance()->getOrderList4Doctor($this->space->user->id, 'confirmed'); $orderCount = BookingClient::getInstance()->getOrderListCount4Doctor($this->space->user->id); $response->orderCount = $orderCount; $response->orderList = array_merge($orderList1, $orderList2); } }