コード例 #1
0
    public function index($request,$response)
    {/*{{{*/
        if($this->user->isNull())
        {
            $response->setRedirect('http://'.URL_PREFIX.'passport.haodf.com/user/login');
            return;
        } 
        $user = $this->user;
        $signin = $this->user->getFollowupPatientSignin();
        if($signin->isNull() == false)
        {
            if($signin->isOpenFollowup() || $signin->isSuspendedFollowup())
            {
                header("Location: http://".URL_PREFIX."passport.haodf.com/myhealth/healthdiary");
                return;
            }
            //在审核通过与待审核状态下
            elseif(false == $signin->isCloseFollowup() && false == $signin->isRefused())
            {
                //同意条款,进中间页
                if($signin->isNoticedYes())
                {
                    $response->setRedirect('http://'.URL_PREFIX.'passport.haodf.com/myhealth/followupserviceinfo');
                    return;
                }
                //管理员拒绝前,未确认条款(也就是没点同意,也没有点不同意),进知情同意书
                if(false == $signin->isNoticed())
                {
                    $response->setRedirect('http://'.URL_PREFIX.'passport.haodf.com/myhealth/manhua');
                    return;
                }
            }
        }

        $limit = 10;
        $flows = DAL::get()->find_all_lastSpacePost_by_user('doctorpatientref', $this->user, $limit);
       // $telProposals = DAL::get()->find_all_by_servicedef_and_userId_and_status('proposal', $this->user, ServiceDef::TYPE_TELORDER, Proposal::STATUS_NORMAL);
        $statuses = array(TelDto::STATUS_UNPAID, TelDto::STATUS_WAITING);
        $telProposals = TelDto::getListByStatuses($this->user, $statuses);
        $bookingOrder = DAL::get()->find_all_by_userid_and_valid('bookingOrder', $this->user->id);

        $relatedObjs = array_merge($telProposals, $bookingOrder, $flows);
        $relatedObjs = $this->sortUpdateTime($relatedObjs);
        $response->relatedObjs = $relatedObjs;

        $indexCnt = 5;
        $myDoctorList = SubscriptionClient::getInstance()->getMyDoctorInfos( $this->user->id );
        $subList = SubscriptionClient::getInstance()->getSubcriptDiseaseList( $this->user->id, $indexCnt );
        $articleRes = SubscriptionClient::getInstance()->getUserSubscriptionArticleList4Web($this->user->id, $total=1);
        $response->articleRes = isset($articleRes['list']) ? $articleRes['list'] : array();
        $lastestTopics = ResidentEvilClient::getInstance()->getTopicsByUserId($this->user->id, 5);

        $answerNaireRes = NfsClient::getInstance()->getAnswerNaireList($user->id, 1, 5);
        $answerNaireList = $answerNaireRes['answerNaireList'];
        $response->answerNaireList = $answerNaireList;

        $response->user = $user;
        $response->lastestTopics = $lastestTopics;
        $response->myDoctorList = $myDoctorList;
        $response->subList = $subList;
    }/*}}}*/