public function showAddOrEdit($request, $response)
 {
     $productADId = $request->id;
     $diseaseId = $request->diseaseId;
     if (!empty($productADId)) {
         $productAD = DAL::get()->find('ProductAD', $productADId);
         $productADAreas = DoctorClient::getInstance()->findByProductADId($productADId);
         $adAreaList = array();
         foreach ($productADAreas['productADAreaList'] as $padArea) {
             $adAreaList[] = $padArea->area;
         }
         $response->adAreaList = $adAreaList;
     }
     $response->provNameList = Area::provInfo4PlussignChannel();
     $response->msg = empty($request->msg) ? $request->msg : '';
     $response->productAD = isset($productAD) ? $productAD : new NullEntity();
     $response->post = empty($productADId) ? 'add' : 'edit?id=' . $productADId;
     $response->productADId = $productADId;
 }
예제 #2
0
    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;
    }/*}}}*/