コード例 #1
0
    public function showTelOrder($request, $response)
    {/*{{{*/
        $this->initialize($request, $response);
        $response->topTitle = "电话咨询";

        $dto = TelDto::create($request->telOrderId);
        $telProposal = $dto->proposal;
        $response->orderStatus = $request->orderStatus;
        //检查订单所有者是否当前用户
        $this->redirectIfCannotSee($dto->proposal);
        $response->telOrder = $dto;
        $response->proposal = $telProposal;
        $response->telOrderId = $request->telOrderId;
        $response->serviceOrder = $dto->order;
    }/*}}}*/
コード例 #2
0
    public function showTelOrder($request, $response, $needCheck=true)
    {/*{{{*/
        $this->initialize($request, $response);
        $response->topTitle = "电话咨询";

        $dto = TelDto::create($request->telOrderId);
        $telProposal = $dto->proposal;
        $response->orderStatus = $request->orderStatus;

        //检查订单所有者是否当前用户
        if($needCheck)
        {
            $this->checkOrderOwnerIsCurUser($dto->proposal, $request->aid);
        }

        $response->telOrder = $dto;
        $response->proposal = $telProposal;
        $response->telOrderId = $request->telOrderId;
        $response->serviceOrder = $dto->order;
    }/*}}}*/
コード例 #3
0
    /**
        * @brief 根据用户id电话订单列表
        * @author whd
        * @exampleUrl http://dev.mobile-api.haodf.com/patientapi/telorder_getTelOrderList?userId=581662815&pageId=1&pageSize=10&xdoc=1
        *
        * @Param $userId 用户id
        * @Param $pageId 当前页码
        * @Param $pageSize 每页显示数
        *
        * @Returns array('id', 'sn', 'price', 'statusDesc', 'spaceId', 'doctorName', 'hospitalName', 'hospitalFacultyName', 'telTime', 'alertMsg', 'needPay', 'needComment', 'doctorAssistant', 'doctorAssistantTel');
     */
    public function getTelOrderList($userId, $pageId, $pageSize)
    {/*{{{*/
        $this->_initPageInfo($pageId, $pageSize);
        $user = DAL::get()->find('user', $userId);
		if ($user->isNull() || $user->id == 0)
		{
            $this->setErrorCode(107);
            return 0;
        }
        $tmpTelList = TelDto::getList4UserMobile($user);
        $telList = array();
        foreach ($tmpTelList as $tmpTel)
        {
            $telList[] = $tmpTel;
        }
        $start = ($pageId - 1) * $pageSize;
        $count = count($telList);
        $pageInfo = array('nowpage'=>$pageId, 'pagesize'=>$pageSize, 'total'=>$count, 'pages'=>ceil($count/$pageSize));
        $this->pageInfo = $pageInfo;
        $telList = array_slice($telList, $start, $pageSize);
        $infos = array();
        foreach($telList as $tel)
        {
            $info = array();
            $info['id'] = $tel->id;
            $info['sn'] = $tel->id;
            $info['doctorAssistant'] = '';
            $info['doctorAssistantTel'] = HdfPhoneNumber::PHONE_FENZHEN;
            $info['needPay'] = 0;
            if($tel instanceof Proposal)
            {
                $serviceOrder = DAL::get()->find_by_source('serviceorder', $tel);
                if(false == $serviceOrder->isNull())
                {
                    $info['id'] = $serviceOrder->id;
                    $info['sn'] = $serviceOrder->id;
                    if ($serviceOrder->isUnpaid() && $tel->isNormalStatus())
                    {
                        $info['needPay'] = 1;
                    }
                }
                $info['doctorAssistant'] = $tel->inspector->realName;
            }
            if ($tel instanceof Intention)
            {
                $info['telTime'] = '未确定';
                if ($tel->isUnAudited() && false == $tel->isPaid())
                {
                    $info['needPay'] = 1;
                }
            }
            else
            {
                $serviceOrder = $this->getServiceOrder($tel);
                $telOrder = $this->getTelOrder($tel);
                if ($telOrder->isNull())
                {
                    $info['telTime'] = '未确定';
                }
                else
                {
                    $info['telTime'] = $telOrder->getTelTime();
                    if (false == $telOrder->isConfirmTime() && $serviceOrder->isPaid() && false == $tel->isCanceled() && false == $tel->isRefunded())
                    {
                        $info['telTime'] = '医生助理正在努力为您联系医生';
                    }
                }
            }
            $info['alertMsg'] = '';
            if ($tel->space instanceof Space)
            {
                $info['spaceId'] = $tel->space->id;
                $info['doctorName'] = $tel->space->host->name;
                $info['hospitalName'] = $tel->space->host->hospitalfaculty->hospital->commonName;
                $info['hospitalFacultyName'] = $tel->space->host->hospitalfaculty->name;
            }
            else
            {
                continue;
            }
            $info['price'] = round($tel->product->salePrice)."元/次(不超过".$tel->product->duration."分钟)";
            $info['truePrice'] = round($tel->product->salePrice);
            $needComment = 0;
            $info['statusDesc'] = $this->getStatus($tel, $needComment);
            $info['needComment'] = $needComment;
            $infos[] = $info;
        }
        $this->content = $infos;
    }/*}}}*/
コード例 #4
0
    public function getPhoneCallOrderListByUserId($userId, $pageId, $pageSize)
    {/*{{{*/
        $this->_initPageInfo($pageId, $pageSize);
        $user = DAL::get()->find('user', $userId);
		if ($user->isNull() || $user->id == 0)
		{
            $this->setErrorCode(107);
            return 0;
        }
        $telList = TelDto::getList4UserMobile($user);
        $start = ($pageId - 1) * $pageSize;
        $count = count($telList);
        $pageInfo = array('nowpage'=>$pageId, 'pagesize'=>$pageSize, 'total'=>$count, 'pages'=>ceil($count/$pageSize));
        $this->pageInfo = $pageInfo;
        $telList = array_slice($telList, $start, $pageSize);
        $infos = array();
        foreach($telList as $tel)
        {
            $info = array();
            if($tel instanceof Proposal)
            {
                $serviceOrder = DAL::get()->find_by_source('serviceorder', $tel);
                if($serviceOrder->isNull())
                {
                    $info['id'] = $tel->id;
                    $info['sn'] = $tel->id;
                }
                else
                {
                    $info['id'] = $serviceOrder->id;
                    $info['sn'] = $serviceOrder->id;
                }
            }
            else
            {
                $info['id'] = $tel->id;
                $info['sn'] = $tel->id;
            }
            $info['doctorName'] = $tel->space->name;
            $info['hospital'] = $tel->space->host->hospitalfaculty->hospital->commonName.$tel->space->host->hospitalfaculty->name;
            $needComment = 0;
            $info['status'] = $this->getStatus($tel, $needComment);
            $infos[] = $info;
        }
        $this->content = $infos;
    }/*}}}*/
コード例 #5
0
 public function showDetail($request, $response)
 {/*{{{*/
     $proposalId = $request->proposalid;
     $proposal = DAL::get()->find('proposal', $proposalId);
     DBC::requireEquals($proposal->patient->user->id, $this->user->id, '您无权查看别人的订单!');
     $bingLiSet = BingLiDtoHelper::create($proposal)->getAll();
     $response->bingliSet = $bingLiSet;
     $response->proposal = $proposal;
     $response->patient = $proposal->patient;
     if($proposal->isFromBooking())
     {
         $bookingDto = BookingDto::createByProposalId($proposal->id);
         $response->bookingDto = $bookingDto;
         $now = XDateTime::now("Y-m-d H:i:s");
         $before1Schedule = $bookingDto->schedule->addDay(-1)->setHour("16")->setMinute("00");
         $before2Schedule = $bookingDto->schedule->addDay(-2)->setHour("20")->setMinute("00");
         $actionStyle = ($now <= $before1Schedule && $now > $before2Schedule) ? "red":'';
         $response->scheduleMessage = "<div class=".$actionStyle."> 加号提示: 请您在".date('Y-m-d H:i', strtotime($before2Schedule))."至".date('Y-m-d H:i', strtotime($before1Schedule))."到此页面领取加号凭证短信</div> ";
     }
     if($proposal->isFromTel())
     {
         $telDto = TelDto::create($proposal->id);
         $response->telDto = $telDto;
         $response->score = $telDto->getScore();
         $response->content = $telDto->getTelVisitContent();
         $flow = DAL::get()->find_by_patientid_and_spaceid('DoctorPatientRef', $proposal->patient->id, $proposal->space->id);
         $response->flow = $flow;
         $response->statusDesc = $telDto->statusDesc;
     }
 }/*}}}*/
コード例 #6
0
    public static function create(User $u, XPager $p)
    {/*{{{*/
        $dto = new self();
        $dto->pager = $p;

        $ids = DAL::get()->queryCtime2Ids('Proposal', $u, ServiceDef::TYPE_TELORDER, array(), array(Proposal::RESULT_FINISH));
        $ids = self::filterProposalIds($ids);
        $proposalDtos = TelDto::getList4User($u, TelDto::STATUS_UNAPPRAISE);
        $proposalIds = TelDto::getAllProposalIds($proposalDtos);
        $ids = $proposalIds+$ids;
        $dto->proposalCnt = count($ids);

        $ids = array_slice($ids, ($p->nowPage-1)*$p->pageSize, $p->pageSize, true);
        $dto->proposals = DAL::get()->find('Proposal', $ids);

        return $dto;
    }/*}}}*/
コード例 #7
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;
    }/*}}}*/