Пример #1
0
    private function initialize($request, $response)
    {/*{{{*/
        $key = $this->key = $request->key;
        $response->urlDiseaseKey = $request->key;

        $this->nowPage = $request->getRequest('p', 1);
        if (empty($key)) {
            $this->_exit404();
        }
        $this->province = $request->province;

        $allArea = Area::provInfo();
        unset($allArea['q']);//不要“其它”省份
        $this->provinceList = $allArea;

        if (isset($this->provinceList[$this->province])){
            $this->provinceName = $this->provinceList[$this->province]['Province'];
        }
        $this->disease = DiseaseClient::getInstance()->getByDiseaseKey($key);
        if($this->disease == null || $this->disease->isNull()){
            $this->_exit404();
        }


        $this->diseaseParent = new NullEntity();
        if(empty($this->disease->parentKey) == false){
            $this->diseaseParent = DiseaseClient::getInstance()->getByDiseaseKey($this->disease->parentKey);
        }

        $this->modules = $this->getModule($key);
        $diseasePage = DiseasePage::getByDiseaseId($this->disease->id);
        $res = $diseasePage->getPaperAndZhuantiList4ZhuantiPage($page=0, $pageSize=10, $options=array('queryType' => self::ZHUANTI_QUERYTYPE_LABLE, 'diseaseId' => $this->disease->id));
        $response->id2Types = $res['id2Types'];

        $response->key = $this->key;
        $response->province = $this->province;
        $response->provinceList = $this->provinceList;
        $response->modules = $this->modules;
        $response->disease = $this->disease;
        $response->diseaseName = $this->disease->name;
        $response->isecho = HdfCookie::echoChangeCity();
    }/*}}}*/