예제 #1
0
    public function askGuidePage($request, $response)
    {/*{{{*/
        $this->initialize($request, $response);
        $response->topTitle = "咨询前必读";

        if(date('Y-m-d H:i:s') <= '2014-04-18 17:30:00' || XDateTime::isSpringHoliday())
        {
            $response->setRedirect(Intention::getZixunNoticeTouchUrl());
            return false;
        } 

        AskSessionInfo::session_destroy();
        if(false == $this->user->isNull())
        {
            AskSessionInfo::bindUser($this->user->id);
        }

        $goUrl = $response->router->urlfor('newcase/checkcondition4pool');
        $caseHostId = $request->getRequest('host_id', 0);
        if($caseHostId > 0)
        {
            $doctor = DAL::get()->find('doctor', $caseHostId);
            if (false == $doctor->isNull())
            {
                if ($doctor->hasSpace() && $doctor->space->isConfirmed())
                {
                    AskSessionInfo::bindSpace($doctor->space->id);
                    $space = AskSessionInfo::getBindSpace();
                    if (false == $space->isNull())
                    {
                        if (false == $space->isCaseOpen())
                        {
                            $response->setRedirect($response->router->urlfor('doctor/casecallin', array('id'=>$doctor->getEncodeId())));
                            return false;
                        }
                        $goUrl = $response->router->urlfor('newcase/checkcondition4spacebefore');
                        $response->askSpace = $space;
                    }
                }
                else
                {
                    $response->setRedirect($response->router->urlfor('doctor/casecallin', array('id'=>$doctor->getEncodeId())));
                    return false;
                }
            }
        }
        $response->goUrl = $goUrl;
    }/*}}}*/