private function getRealData($hospital) {/*{{{*/ $display = array(); if($hospital instanceof hospital) { $display['hospital'] = $hospital->name; $display['picurl'] = ''; $display['site'] = ''; $display['orderurl'] = ''; $display['aptitude'] = Hospital::$GradeDefine[$hospital->grade]; $display['type'] = $hospital->categoryDesc(); $hospitalAddressInfos = $this->getAddress($hospital->address); $display['addressnum'] = count($hospitalAddressInfos); foreach($hospitalAddressInfos as $key=>$address) { $display[$key]['addresses']['num'] = $key + 1; $display[$key]['addresses']['location'] = $address; if (Area::isZXS($hospital->province)) { $display[$key]['addresses']['area'] = $hospital->city."ÊÐ"; } else { $display[$key]['addresses']['area'] = $hospital->province."Ê¡".$hospital->city."ÊÐ"; } } $phones = $this->getPhone($hospital->phone); $display['telnum'] = count($phones); $display['phones'] = $phones; if (empty($hospital->conclusion)) { $display['introduction'] = trim(strip_tags(XString::truncate($hospital->intro, 160))); } else { $display['introduction'] = trim(strip_tags(XString::truncate($hospital->conclusion, 160))); } $display['hospitalurl'] = $hospital->getUrl(); $display['comments'] = $this->getComments($hospital); $display['moreComment'] = $hospital->getDiseaseUrl(); $hfList = $this->getHospitalFacultyInfo($hospital->id); $display['officenum'] = count($hfList); $display['hfInfo'] = $this->formatHospitalFaculty($hfList); $doctors = $this->getHospitalDoctorInfos($hospital->id); $display['hospitalDoctorCnt'] = $hospital->doctorCount; $display['docInfo'] = $this->formatHospitalDoctors($doctors); BeanFinder::get('LocalCache')->removeAll(); } return $display; }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $facultyIds = FacultyClient::getInstance()->getFacultyListByOption($nowPage, $pageSize); $faculties = DAL::get()->find('Faculty', $facultyIds['ids']); $provinces = Area::getAllProvinceNameList(); $provinces[] = "全国"; $res = array(); foreach ($faculties as $faculty) { $info['key'] = $faculty->name; $offices = $doctorInfos = array(); foreach ($provinces as $province) { if (Area::isZXS($province)) { $cities = array($province); } elseif($province == "全国") { $cities = array("全国"); } else { $cities = Area::getProvinceCities($province); $cities[] = $province; } foreach ($cities as $city) { $options = array(); $options['facultyId'] = $faculty->id; $options['orderBy']['rank'] = true; $options['isVirtual'] = 0; $options['hospitalIsActivated'] = 1; if ($city != "全国") { if (Area::isProvince($city) || Area::isZXS($city)) { $options['province'] = $city; $areaUrl = "http://haoping.haodf.com/keshi/".$faculty->getEncodeId()."/keshi/".Area::getProvKeyByName($city).".htm"; } else { $options['city'] = $city; $str = Area::retrieveCityEnglishName($province, Area::getProvKeyByName($province), $city); $areaUrl = "http://haoping.haodf.com/keshi/".$faculty->getEncodeId()."/keshi/".Area::getProvKeyByName($province).".htm?city=".$str; } } else { $areaUrl = "http://haoping.haodf.com/keshi/".$faculty->getEncodeId()."/keshi/all.htm"; } $hospitalfaculties = HospitalFacultyClient::getInstance()->getHospitalFacultyByOption(1, 30, $options); if (false == empty($hospitalfaculties)) { $office['area'] = $city; $office['areaurl'] = $areaUrl; foreach ($hospitalfaculties as $hospitalfaculty) { if ($hospitalfaculty->doctorCount < 1) { continue; } $officeInfo['office']['officename'] = $hospitalfaculty->hospital->name.$hospitalfaculty->name; $officeInfo['office']['city'] = $hospitalfaculty->hospital->city; $officeInfo['office']['officeurl'] = $hospitalfaculty->getUrl(); $officeInfo['office']['aptitude'] = $hospitalfaculty->hospital->getGradeStr(); $officeInfo['office']['gooddoctornum'] = $hospitalfaculty->doctorCount; $officeInfo['office']['votenum'] = $hospitalfaculty->rank; $office[] = $officeInfo; $officeInfo = array(); } $offices[] = array('offices' =>$office); $office = array(); } $page = $params = array(); $page['nowPage'] = 1; $page['pageSize'] = 30; $doctorList = DoctorClient::getInstance()->getDoctorBetweenFaculty($faculty->id, $faculty->id+1, $options, $page); if (false == empty($doctorList['list'])) { $doctors['area'] = $city; $pre = "all"; if ($city != "全国") { $pre = Area::getProvKeyByName($province); } $doctors['areaurl'] = "http://haoping.haodf.com/keshi/".$faculty->getEncodeId()."/daifu/".$pre.".htm"; $doctorInfo = array(); foreach ($doctorList['list'] as $doctor) { if (74154 != $doctor->id && $doctor->hospitalfaculty->hospital->isActivated && $doctor->hospitalfaculty->hospital->name != "未收录医院") { $doctors['doctor']['doctorname'] = $doctor->name; $doctors['doctor']['doctorurl'] = $doctor->getUrl(); $doctors['doctor']['doctorgrade'] = $doctor->grade ? $doctor->grade : " "; $doctors['doctor']['doctorjob'] = $doctor->educateGrade ? $doctor->educateGrade : " "; $doctors['doctor']['hospitalname'] = $doctor->hospitalfaculty->hospital->commonName; $doctors['doctor']['hospitalurl'] = $doctor->hospitalfaculty->hospital->getUrl(); $doctors['doctor']['votenum'] = $doctor->rank; $doctorInfo[] = $doctors; $doctors = array(); } } $doctorInfos[] = array('doctors' => $doctorInfo); $doctorInfo = array(); } } BeanFinder::get('LocalCache')->removeAll(); } $offices = array_filter($offices); $doctorInfos = array_filter($doctorInfos); $info = array_merge($info, $offices, $doctorInfos); $res[] = array('item' => $info); $info = array(); } return $res; }/*}}}*/