public function followupCustomerManage($request, $response) { /*{{{*/ $followupAuditor = DAL::get()->find_by_auditorid('FollowupAuditor', $this->auditor->id); if ($followupAuditor->role->name != FollowupAuditorRole::NAME_SALESEXECUTIVE) { echo "您没有权限!仅销售主管可进入!"; return parent::DIRECT_OUTPUT; } $searchType = $request->searchtype; $response->searchType = $searchType; $response->saleAuditorList = DAL::get()->find_all_by_roleName('followupauditor', FollowupAuditorRole::NAME_SALES); $response->followupHospitalList = FollowupClient::getInstance()->getFollowupHospital(); $response->provinceList = Area::provInfoAll(); $page = $request->getRequest('page', 1); $pageSize = 15; $params = array(); if ('allocate' == $searchType) { $params['customerName'] = $request->customername; $params['saleAuditorId'] = $request->saleauditorid; $params['deleted'] = $request->deleted; $params['forbidSale'] = $request->forbidsale; $params['hospitalid'] = $request->hospitalid; $params['province'] = $request->province; $params['surgerydatefrom'] = $request->surgerydatefrom; $params['surgerydateto'] = $request->surgerydateto; $response->params = $params; if ($params['saleAuditorId'] == 0 && false == isset($params['deleted'])) { $params['deleted'] = 0; } $res = FollowupClient::getInstance()->getCustomerList($page, $pageSize, $params); $response->customerList = $res['followupCustomerList']; } if ('lock' == $searchType) { $params['lockStatus'] = $request->lockstatus; $params['customerRealName'] = $request->customerrealname; $params['saleAuditorId'] = $request->saleauditorid; $params['startTime'] = $request->starttime; $params['endTime'] = $request->endtime; $response->params = $params; $res = FollowupCustomerClient::getInstance()->getCustomerByLockStatus($page, $pageSize, $params); $response->customerList = $res['customerList']; } if ('amiss' == $searchType) { $recordList = FollowupCustomerClient::getInstance()->getAmissInfoRecord(); $response->recordList = $recordList; } if ('customerwithrecord' == $searchType) { $saleAuditorId = $request->saleauditorid; $response->saleAuditorId = $saleAuditorId; $startTime = $request->starttime; $response->startTime = $startTime; $endTime = $request->endtime; $response->endTime = $endTime; $customer_DotimeList = FollowupCustomerClient::getInstance()->getCustomerListAndRecordDoTime($saleAuditorId, $startTime, $endTime); $response->customerList = $customer_DotimeList['customerList']; $response->dotimeList = $customer_DotimeList['dotimeList']; } $pageParams = ""; foreach ($params as $key => $value) { $pageParams .= strtolower($key) . "=" . $value . "&"; } $pageParams .= "searchtype=" . $searchType; if (false == empty($res['pageInfo'])) { $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate("/followup/followupcustomermanage?{$pageParams}&page="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']); } }
<div class="pr25"> <!--好评医生列表开始--> <!--好评医生列表开始--> <p class="pt20 fs pb10 gray3">好评票是该医生所治疗的<?=$disease->name?>患者对其进行的投票,看病经验是<?=$disease->name?>患者经该医生治疗后的经验分享</p> <ul class="fs hp_doc clearfix"> <?php if (true == empty($doctorList)) { $emptyInfo = '相关医生'; $provinceName = ''; $provinceList = Area::provInfoAll(); if (isset($provinceList[$province])){ $provinceName = $provinceList[$province]['Province']; } $services = DiseasePage::$services; $serviceForShow = isset($services[$service])?$services[$service]:'全部'; $grades = DiseasePage::getHospitalGrades(); $gradeDes = isset($grades[$hospitalGrade]) ? ' '.$grades[$hospitalGrade] : ''; $emptyInfo = '"'.$provinceName.' '.$serviceForShow.' '.$gradeDes.' ' .$doctorGrade.'" 的推荐医生'; ?> <? include_once dirname(__file__).'/../common/_noresult_inner.php'; ?> <?php } ?> <?php $spaceIds = array();
<!-- start zx-doctor --> <?php include("_askspace.php");?> <!-- end zx-doctor --> <DIV class="zxPost-noticeShell"> <DIV class="zxPost-notice_1 f16 fb zoom clearfix"> <P class=mt5> <SPAN class="fl f24 blue">好大夫在线网站医学助理亲切提示 <label class="red">(必读!)</label></SPAN> </P> </DIV> </DIV> <!-- start zxPost-content --> <?php $province = Area::getIpProvince(); $provInfo = Area::provInfoAll(); $provinceKey = ''; foreach($provInfo as $key => $prov) { foreach($prov as $name => $value) { if($name == 'Province') { if($value == $province) { $provinceKey = $key; break; } } } }
public function search($request, $response) { /*{{{*/ $diseasename = $request->diseasename; $encode = mb_detect_encoding($request->diseasename, array('UTF-8', 'GBK')); if ($encode == 'UTF-8' && preg_match("/^[\\x{4e00}-\\x{9fa5}A-Za-z0-9_]+\$/u", $diseasename)) { $diseasename = mb_convert_encoding($request->diseasename, "gbk", "utf-8"); } $response->fivehospitals = $this->get5hospitals4content(); $diseasename = rawurldecode($diseasename); $area = Area::provInfoAll(); if (isset($area[$request->province]) && $area[$request->province] != '') { $province = $area[$request->province]['Province']; } else { $province = rawurldecode($request->province); } $facultyname = DoctorClient::getInstance()->redirectFacultyname(rawurldecode($request->facultyname)); $hospitalname = $request->hospitalname; if ($hospitalname == '-输入医院名称-') { $hospitalname = ''; } $hospitalname = rawurldecode($hospitalname); if ($hospitalname) { $hospitalFacultyList = DAL::get()->queryHospitalFacultyName('doctoroutline', $hospitalname); } if ($province == '全部' || $province == '-请选择医院省份-' || $province == 'all') { $province = ''; } if ($facultyname == '全部') { $facultyname = ''; } //当有疾病条件的时候,左侧科室内容清空,反过来还是 if (!empty($facultyname)) { $diseasename = ''; } if ('请输入疾病关键词' == $diseasename) { $diseasename = ''; } $nowpage = strlen($request->nowpage) > 0 ? $request->nowpage : 1; // $response->diseasename = rawurlencode($diseasename);//保留原始疾病转码,如果线上无问题,可以删除 // $response->province = rawurlencode($province); // $response->facultyname = rawurlencode($facultyname); // $response->hospitalname = rawurldecode($hospitalname); $response->diseasename = $diseasename; $response->province = $province; $response->facultyname = $facultyname; $response->hospitalname = $hospitalname; $response->nowpage = $nowpage; $response->directProvinces = $this->getDirectProvince(); $response->indirectProvinces = $this->getIndirectProvince(); $response->diseases_str = $this->getdisease4new($facultyname); $pagesize = 10; //新加的右边搜索条件 $hosfaculty = DoctorClient::getInstance()->redirectFacultyname(rawurldecode($request->hosfaculty)); $response->facultyListForLeft = DAL::get()->queryFacultyListForLeft('DoctorOutLine'); $response->hosfaculty = $hosfaculty; $hospitalFacultyList = array(); if ($hospitalname) { $hospitalFacultyList = DAL::get()->queryHospitalFacultyName('doctoroutline', $hospitalname); } $response->hospitalFacultyList = $hospitalFacultyList; $finalFacultyName = ''; //在搜索时两种科室只可能有一种存在值 if (!empty($hosfaculty) || !empty($facultyname)) { $finalFacultyName = false == empty($hosfaculty) ? $hosfaculty : $facultyname; } $response->finalFacultyName = $finalFacultyName; $response->facultyList = DAL::get()->queryFacultyList('DoctorOutLine', $finalFacultyName, $hospitalname); $infos = DoctorClient::getInstance()->getDoctorListFor400Search($diseasename, $province, $finalFacultyName, $hospitalname, $nowpage, $pagesize = 10); if ($diseasename && $nowpage <= 1) { $topResults = DoctorClient::getInstance()->get3Doctors($diseasename, $province, $finalFacultyName, $hospitalname); } else { if ($finalFacultyName && $nowpage <= 1) { $topResults = DoctorClient::getInstance()->get3FacultyDoctors($province, $finalFacultyName, $hospitalname); if (false == empty($topResults) && false == empty($topResults['info'])) { foreach ($topResults['info'] as $tmpTopResults) { $unDoctorIds[$tmpTopResults['doctorid']] = $tmpTopResults['doctorid']; } $response->topDoctorIds = isset($unDoctorIds) ? $unDoctorIds : array(); } } } //计算显示医生数 $totalDoctorCount = 0; $infosDoctors = $topInfosDoctors = array(); if (isset($infos['info'])) { $infosDoctors = $infos['info']; } if (isset($topResults['info'])) { $topInfosDoctors = $topResults['info']; } if (isset($infos['pageInfo']['total']) && $infos['pageInfo']['total'] > 10) { $totalDoctorCount = $infos['pageInfo']['total']; } else { $totalDoctorCount = count(array_keys($infosDoctors + $topInfosDoctors)); } $response->totalDoctorCount = $totalDoctorCount; $hospitalNameAndCnt = array(); if ($facultyname) { $hospitalNameAndCnt = $this->getHospitalNameAndCnt($infos['hospitaldoctorcounts']); } $response->hospitalNameAndCnt = $hospitalNameAndCnt; if ($diseasename) { $response->topDoctorIds = isset($infos['unUserIds']) ? $infos['unUserIds'] : array(); } $response->topResults = isset($topResults) ? $topResults : array(); $infos['totalDoctorCount'] = $infos['pageInfo']['total']; $response->infos = $infos; $response->facultycounts = $infos['facultycounts']; //一级科室计数 $mainfacultydisplay = array(); foreach ($response->facultyList as $mainfaculty => $subfaculties) { foreach ($subfaculties as $subfacultyname) { if (isset($response->facultycounts[$subfacultyname['facultyname']])) { $mainfacultydisplay[$mainfaculty] = true; } } } $response->mainfacultydisplay = $mainfacultydisplay; $response->encoded_diseasename = $encoded_diseasename = rawurlencode($diseasename); $response->encoded_provinve = $encoded_province = rawurlencode($province); $response->encoded_facultyname = $encoded_facultyname = rawurlencode($facultyname); $response->encoded_hosfaculty = $encoded_hosfaculty = rawurlencode($hosfaculty); $response->encoded_hospitalname = $encoded_hospitalname = rawurlencode($hospitalname); $pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate("/index/search?diseasename={$encoded_diseasename}&province={$encoded_province}&facultyname={$encoded_facultyname}&hosfaculty={$encoded_hosfaculty}&hospitalname={$encoded_hospitalname}&nowpage="), $infos['pageInfo']['nowpage'], $infos['pageInfo']['pagesize'], $infos['pageInfo']['total']); $response->pageLink = $pageLink; if (false == empty($topResults['doctorIds'])) { $doctorSatisfactionList = PaymentClient::getInstance()->getDoctorSatisfactionList(array_merge($infos['doctorids'], $topResults['doctorIds'])); } else { $doctorSatisfactionList = PaymentClient::getInstance()->getDoctorSatisfactionList($infos['doctorids']); } $response->doctorSatisfactionList = $doctorSatisfactionList; if ($province) { $response->hospitalnames = DAL::get()->queryHospitalByProvince('DoctorOutLine', $province); } $response->hospitalcounts = $infos['hospitalcounts']; $response->hasCondition = true; if (empty($diseasename) && empty($province) && empty($facultyname) && empty($hospitalname)) { $hospitalcounts = array(); if (false == empty($infos['hospitalcounts'])) { $hospitalcounts = $this->get5hospitals($infos['hospitalcounts']); } $response->hospitalcounts = $hospitalcounts; $response->hasCondition = false; } $response->type = 'search'; //返回页面类型,暂时用于控制二级导航 //返回其父科室,如果是一级科室则还是一级科室 $facultyParentTmp = ''; $isfacultySon = false; if (!empty($facultyname) || !empty($hosfaculty)) { $facultyParentTmp = empty($hosfaculty) ? $facultyname : $hosfaculty; foreach ($response->facultyList as $_mainfacultyname => $subfaculties) { foreach ($subfaculties as $subfaculty) { if (rawurldecode($facultyParentTmp) == $subfaculty['facultyname']) { $facultyParentTmp = $subfaculty['parentfacultyname']; $isfacultySon = true; } } } if (empty($hosfaculty)) { $response->hosfacultyParent = ''; $response->isHosFacultySon = false; $response->isFacultySon = $isfacultySon; $response->facultyParent = $facultyParentTmp; } else { $response->hosfacultyParent = $facultyParentTmp; $response->isHosFacultySon = $isfacultySon; $response->isFacultySon = false; $response->facultyParent = ''; } } else { $response->hosfacultyParent = $facultyParentTmp; $response->isHosFacultySon = $isfacultySon; $response->isFacultySon = $isfacultySon; $response->facultyParent = $facultyParentTmp; } $response->showParentFaculty = $facultyParentTmp; //提示信息来源条件 $phoneServiceLists = PaymentClient::getInstance()->getReturnVisits($infos['userids'], true); $response->phoneServiceLists = $phoneServiceLists; $response->ScoreDesc = TelVisit::$scoreDesc; $response->showfacultyName = $request->facultyname; $response->selectHospitalFacultyNameList = $this->getHospitalFacultyName($hospitalname); //热门疾病 $doctorOutlines = DAL::get()->find_all_by_facultyname('doctoroutline', $finalFacultyName); if (empty($doctorOutlines)) { $doctorOutlines = DAL::get()->find_all_by_parentfacultyname('doctoroutline', $finalFacultyName); } $facultyIds = array(); foreach ($doctorOutlines as $doctorOutline) { $facultyIds[] = $doctorOutline->facultyid; } $facultyIds = array_unique($facultyIds); $diseaseIds = array(); if (!empty($facultyIds)) { $diseaseIds = DAL::get()->find_id_diseaseIdFromFacultyIds('diseasefaculty', $facultyIds); } $hotDiseaseList = array(); if (!empty($diseaseIds)) { $hotDiseaseList = PaymentClient::getInstance()->getHotDiseaseList(self::HOT_DISEASE_COUNT, $diseaseIds); //咱设置为显示8个标签 } if (empty($hotDiseaseList)) { $hotDiseaseList = PaymentClient::getInstance()->getHotDiseaseList(self::HOT_DISEASE_COUNT); } $hotDiseaseNameList = array(); $hotDiseaseUrl = array(); foreach ($hotDiseaseList as $k => $v) { $hotDiseaseNameList[] = $v->name; } $response->hotDiseaseNameList = $hotDiseaseNameList; $diseaseFirstFaculty = null; if (false == empty($diseasename) && empty($facultyname) && empty($hospitalname) && empty($province) && $infos['totalDoctorCount'] < 6 && $infos['totalDoctorCount'] > 0 && empty($diseasename)) { $diseaseEntity = DAL::get()->find_by_name('disease', $diseasename); if (false == $diseaseEntity->isNull()) { $diseaseFirstFaculty = $diseaseEntity->getFirstFaculty(); } } //wk //如果有疾病,有医院,但无其他条件,结果为空 if ($infos['totalDoctorCount'] == 0 && empty($topResults)) { if (false == empty($diseasename)) { if (false == empty($hospitalname) && empty($hosfaculty) && empty($facultyname)) { $infos2 = DoctorClient::getInstance()->getDoctorListFor400Search('', '', '', $hospitalname, $nowpage, $pagesize = 3); $response->infos2 = $infos2; $doctorSatisfactionList2 = PaymentClient::getInstance()->getDoctorSatisfactionList($infos2['doctorids']); $response->doctorSatisfactionList2 = $doctorSatisfactionList2; } } } $userIds = array(); if (false == empty($infos['disease'])) { foreach ($infos['disease'] as $userId => $info) { $userIds[] = $userId; } } if (false == empty($infos2['disease'])) { foreach ($infos2['disease'] as $userId => $info) { $userIds[] = $userId; } } if (isset($topResults['info'])) { $userIds = array_merge($userIds, array_keys($topResults['info'])); } if (false == empty($userIds)) { $response->productList = ProductClient::getInstance()->getProductsBySpaceIds($userIds, array(ServiceDef::TYPE_TELORDER)); } $response->diseaseFirstFaculty = $diseaseFirstFaculty; }
private function diseasePageDoctor($request, $response, $diseasePage) {/*{{{*/ $this->provinceList = Area::provInfoAll(); if (isset($this->provinceList[$this->province])){ $this->provinceName = $this->provinceList[$this->province]['Province']; } unset($this->provinceList['xizang']); $response->provinceList = $this->provinceList; $options = array(); if(false == empty($this->provinceName)) { $options['prov'] = $this->provinceName; } $service = $request->service; $response->service = $service; if (false == empty($service)) { $options['service'] = $service; } $hospitalGrade = $request->hospitalGrade; $response->hospitalGrade = $hospitalGrade; if (false == empty($hospitalGrade)) { $options['hospitalGrade'] = $hospitalGrade; } $doctorGrade = $request->doctorGrade; $response->doctorGrade = $doctorGrade; if (false == empty($doctorGrade)) { $options['doctorGrade'] = $doctorGrade; } $page = $request->getRequest('p', 1); $pageSize = $request->getRequest('pageSize', 15); $res = $diseasePage->getDoctorList4DoctorPage($page, $pageSize, $options); $response->doctorList = array(); $response->pageLink = null; if (false == empty($res['ids'])) { $response->doctorList = DAL::get()->find('doctor', $res['ids']); $fullUrl = DiseasePage::getDoctorUrl($this->disease->key, $this->province, $service, $hospitalGrade, $doctorGrade); $fullUrl = str_replace('/daifu_1', '/daifu_@', $fullUrl); list($preUrl, $appendUrl) = explode('@', $fullUrl); $pageUrl = PageNav::getPageNavTemplate4DiseasePage($preUrl, 2, 3, 1, true, $appendUrl); $response->pageLink = PageNav::getNavLink($pageUrl, $page, $pageSize, $res['total']); } $doctorCnt = isset($res['total'])?$res['total']:0; $title = "{$this->provinceName}{$this->disease->name}专家_好大夫在线"; $keywords = "{$this->provinceName}{$this->disease->name}病专家,{$this->provinceName}{$this->disease->name}专家排名,{$this->provinceName}最好的{$this->disease->name}专家"; $description = "{$this->provinceName}{$this->disease->name}专家,根据患者投票评选的{$this->provinceName}{$this->disease->name}专家排名,含{$this->provinceName}{$this->disease->name}专家{$doctorCnt}位。查询门诊时间、咨询专家、预约专家门诊,帮您找到{$this->provinceName}最好的{$this->disease->name}专家。"; if ($page != 1 && $this->provinceName) { $title = $this->provinceName.$this->disease->name."专家_".$this->disease->name."好评专家推荐第".$this->nowPage."页_好大夫在线"; $keywords = ""; $description = ""; } $response->title = $title; $response->keywords = $keywords; $response->description = $description; }/*}}}*/
public function loadMoreHospital($request, $response) {/*{{{*/ $this->initialize($request, $response); $provinceName = ''; $provinceList = Area::provInfoAll(); if (isset($provinceList[$this->province])) { $provinceName = $provinceList[$this->province]['Province']; } $response->provinceName = $provinceName; $binds = array(); $binds['needPage'] = true; if($provinceName) { $binds['province'] = $provinceName; } $diseaseId = $this->disease->voteDisease->id; $nowPage = $request->getRequest('p', 1); $res = DiseaseClient::getInstance()->getDiseaseHospitalByDisease($diseaseId, $binds, $nowPage, self::PAGESIZE_LIST); $response->diseaseHospitalList = $res['diseaseHospitalList']; $response->nowPage = $res['pageInfo']['nowpage']; $response->pages = $res['pageInfo']['pages']; $response->total = $res['pageInfo']['total']; $response->loadUrl = $response->touchUrl.'/disease/loadmorehospital?id='.$request->id.'&selected='.$response->selected.'&p='; }/*}}}*/