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', '')); $this->skipHospitals($enHospitalId, $response); $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(false == is_array($out) || empty($out)) { header('location: http://jiahao.haodf.com/'); return parent::DIRECT_OUTPUT; } $response->showBSG = array(); if($district =='北京'||$district =='上海'||$district =='广东') { $showBSG = PlussignChannelClient::getInstance()->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); $sets = array(); $sets['appointTime'] = $sets['spaceIds'] = $sets['requirements'] = array(); $sets['pageLink'] = ''; 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; }/*}}}*/
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; }/*}}}*/