public function notice($request, $response) {/*{{{*/ if(XDateTime::isSpringHoliday()) { $response->setRedirect(Intention::getIntentionTongzhiUrl()); return false; } $response->next = $request->next; $response->refer = $request->refer; }/*}}}*/
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; }/*}}}*/
private function ensureCanAsk($request, $response) {/*{{{*/ $caseHostUserId = $request->getRequest('host_user_id', 0); $askSpace = DAL::get()->find('space', $caseHostUserId); if(XDateTime::isSpringHoliday() || XDateTime::isClosedThreadTime()) { AskSessionInfo::session_destroy(); $response->setRedirect(Intention::getIntentionTongzhiUrl()); return false; } if(false == $askSpace->isNull()) { if ($askSpace->host instanceof Doctor) { $askSpace->host->doctorIsDead(); } if ($this->skipHospitals($askSpace) || $this->skipDoctors($askSpace)) { $response->setRedirect('http://www.'.URL_PREFIX.'haodf.com/info/spacefrontnotice.php'); return false; } } try { SpaceClient::getInstance()->ensureAllowAskRule($this->_newUser, $askSpace); } catch(SpaceUnconfirmException $ex) { $response->setRedirect('http://'.URL_PREFIX.'zixun.haodf.com/newcase/askintentionintro?spaceid='.$askSpace->id.'&message='.$ex->getMessage()); return false; } catch(SpaceCaseClosedException $ex) { $message = "暂时关闭,无法回复您的问题。"; $response->setRedirect('http://'.URL_PREFIX.'zixun.haodf.com/newcase/askintentionintro?spaceid='.$askSpace->id.'&message='.$message); return false; } catch(SpaceForbiddenAnswerException $ex) { $message = "暂时关闭,无法回复您的问题。"; $response->setRedirect('http://'.URL_PREFIX.'zixun.haodf.com/newcase/askintentionintro?spaceid='.$askSpace->id.'&message='.$message); return false; } return true; }/*}}}*/
public function showFuwaiAsk($request, $response) {/*{{{*/ if (XDateTime::isSpringHoliday()) { $response->setRedirect(Intention::getIntentionTongzhiUrl()); return false; } $space = array(); if ($request->host_user_id) { $space = DAL::get()->find('space', $request->host_user_id); if($space->isNull() == false && ($space->modulecase->allowNewMaxNumber == 0 || $space->isCaseAndNewCaseOpen() == false || $space->isNewCaseOpen() == false || false == $space->user->allowAnswer())) { throw new BizException('此功能暂时关闭'); } } $response->caseTitle = $request->case_title; $response->isLogin = UserClient::getInstance()->isLogin(); $response->space = $space; $response->categoryList = ThreadCateClient::getInstance()->getTopLevelList(); }/*}}}*/
public function showAsk($request, $response) {/*{{{*/ if (XDateTime::isSpringHoliday()) { $response->setRedirect(Intention::getIntentionTongzhiUrl()); return false; } $caseHostUserId = $request->getRequest('host_user_id', 0); //判断是否存在流关系:要判断caseHostUserId不可为空 if($this->_newUser->isNull() == false && empty($caseHostUserId) == false) { $patients = $this->_newUser->patients; $patient = array_shift($patients); $doctorPatientRef = new NullEntity(); if($patient != null) { $doctorPatientRef = FlowClient::getInstance()->getValidFlowRef($caseHostUserId, $patient->id); } if($doctorPatientRef->isNull() == false) { $response->setRedirect($doctorPatientRef->url); return; } } $attachments = array(); if (false == $this->_newUser->isNull()) { //附件的获取 $attachments = $this->_newUser->attachments; if (is_array($attachments) == false){ if ($attachments->isNull()) $attachments = array(); } } $response->patientAttachments = $attachments; $askSpace = array(); if ($caseHostUserId) { $askSpace = DAL::get()->find('space', $caseHostUserId); } /** 登录用户的咨询列表 */ $userCaseList = array(); /** 用户提问的一些限制 */ $out = array(); $res = $this->_userIsAllowAsk($askSpace, $out, $response); //咨询区未满,并且允许普通用户或者患者提问 if ($res && false == $out['askSpaceFull'] && ($out['allowUserAsk'] || $out['allowPatientAsk'])) { $response->askSpaceObjectBefore = array(); } else { $response->askSpaceObjectBefore = $askSpace; $askSpace = array(); } $patients = $this->_newUser->patients; if(is_array($patients) && false == empty($patients)) { $patient = array_shift($patients); } else { $patient = new NullEntity(); } $response->patientInfo = $patient; $response->askSpaceRes = $out; $response->askSpace = $askSpace; $response->userCaseList = $userCaseList; $response->moduleCase = array(); $response->allowPhone = isset($out['allowPhone'])?$out['allowPhone']:false; }/*}}}*/
public function orderForm($request, $response) {/*{{{*/ if(XDateTime::isSpringHoliday()) { $response->setRedirect('http://www.haodf.com/info/bookingtongzhi.html'); return false; } $this->forceSpaceModuleCheck('PlusSign', $response); $transfer = $request->transfer; $verify = $request->verify; $transferKey = $this->_verifyKey($transfer); $isVerify = isset($request->transfer) ? ($verify == $transferKey) : true; if($transfer == null || !$isVerify) { $response->setRedirect($this->_newSpace->getUrl().'booking/orderformlist'); return false; } if ($this->_newUser->isNull()) { $url = 'http://'.URL_PREFIX.$this->_newSpace->userName.'.haodf.com/booking/orderform?transfer='.$transfer.'&verify='.$transferKey; $response->setRedirect('http://'.URL_PREFIX.'passport.haodf.com/user/login?fromType=jiahao&doctorname='.$this->_newSpace->name.'&forward='.urlencode($url)); return false; } if($this->isDoctorSubmitBooking4Itself()) { $this->message('医生不能给自己提交加号!', $response, array('forward'=>"http://".URL_PREFIX."{$this->_newSpace->userName}.haodf.com")); } //加号回访提示 $retVisitCount = BookingClient::getInstance()->getNoReturnVisitOrderCount('bookingorder', $this->_newUser->id); if($retVisitCount > 0){ $response->setRedirect($this->_newSpace->getUrl().'booking/bookingordertipsinfo?transfer='.$request->transfer); } $schedulelist = $this->_newSpace->getSpaceBusinessRequirement4Booking()->serializedSchedule; $list = explode(",", $transfer); $date = $list[0];//日期 $datetime = urldecode($list[1]);//上午,下午 //把时间变成对比的星期几 list($compareField, $week) = $this->switchDataTime($date, $datetime); //查出该数组离得内容,用来显示 foreach($schedulelist as $schedule){ if(in_array($compareField, $schedule)){ $showContent = $schedule; $response->showContent = $showContent; } } /*以上为显示用*/ if (false == $this->_newSpace->isBookingOpened()) { $this->message('目前医生关闭了预约加号服务!', $response, array('forward'=>"http://{$this->_newSpace->userName}.haodf.com")); return false; } $patient = DAL::get()->find('patient', $request->patientid); $response->user = $this->_newUser; $response->patients = $this->_newUser->patients; $response->date = $date; $response->datetime = $datetime; $response->week = $week; $response->transfer = $transfer; $response->spaceBusinessRequirement = $this->_newSpace->getSpaceBusinessRequirement4Booking(); $response->space = $this->_newSpace; $response->contract = $this->_newSpace->getBookingContract(); $response->patient = $patient; $response->patientAttachments = $this->_newUser->attachments; }/*}}}*/
<?php $patientAttachments = $proposal->patient->attachments?> <div class = 'user_replenish' style="display:none" id='user_replenish_area' name='user_replenish'> <?php if(XDateTime::isSpringHoliday()){?> <span class='red clearfix mt10 f16 mb10'>春节假日期间,您可以正常提交、补充您的医疗请求。但是在2014年2月4日09:00之前,网站暂时无法审核、处理您的医疗请求。2014年2月4日09:00以后,审核工作恢复正常。</span> <?php } ?> <div class="h_ctime_h3 mt10"> <h3>添加新的病例资料</h3> </div> <form class="replenish" method="post" action="/proposal/replenish" onsubmit="return submitReplenish();"> <input type="hidden" name="proposalid" value=<?=$proposal->id?>> <input type="hidden" id="el_patient_attachment_ids" name="attachmentIds" value=""/> <div> <textarea id="content", name="content" class="content_textarea_in"></textarea> </div> <?php include_once('binglidetail/_addattach.php'); ?> <div class="h_operation3" id="submit_pot" ><input type="submit" value="提交"></div> </form> </div> <script type="text/javascript" src="http://i1.hdfimg.com/js/attach/zixun_upload.js?20140609"></script> <script type="text/javascript"> function showOldAttach() { var default_ids = $("#el_patient_attachment_ids").val(); fancyBoxOpenWindow('/bingli/oldbl/'+default_ids+'.htm?patientId=<?=$patient->id ?>&bingli4space=1'); } function showMyAttach(id, addLastest, paId, patientId)
public function service($request, $response) {/*{{{*/ $response->title= ""; if(false && XDateTime::isSpringHoliday()) { if ($request->telOrderId) { $currentUrl = $response->router->urlfor('tel/service', array('entityid' => $request->entityid, 'telOrderId' => $request->telOrderId)); } else { $currentUrl = $response->router->urlfor('tel/service', array('entityid' => $request->entityid)); } $response->setRedirect($response->router->urlfor('tel/holidaynotice', array('id'=> $request->entityid, 'from' => $currentUrl))); return false; } if (($request->entityid && $request->entityid > 0) || $request->telOrderId != '') { $doctor = DAL::get()->find('doctor', $request->entityid); $response->products = $products = ProductClient::getInstance()->getProducts($doctor->space, array(ServiceDef::TYPE_TELORDER)); $response->doctor = $doctor; if ($request->telOrderId != '') { $response->telOrderId = $request->telOrderId; }else if(count($products) == 1){ $product = array_shift($products); $response->setRedirect($response->router->urlfor('tel/telorderform', array('productId'=> $product->id))); } } else { $this->_exit404(); } }/*}}}*/
public function getBookingNeedInfo($userId, $doctorId) {/*{{{*/ if(XDateTime::isSpringHoliday()) { $this->setErrorCode(902); return 0; } $request = new Request(); $os = $request->getRequest('os'); if(false == empty($os) && $os == 'ios' && $this->isBookingServiceSuspendTime()) { $this->setErrorCode(902); return 0; } $user = DAL::get()->find('user', $userId); $doctor = DAL::get()->find('doctor', $doctorId); if($doctor->isNull()) { $this->setErrorCode(132); return 0; } if ($user->isNull()) { $this->setErrorCode(107); return 0; } $opend = $doctor->space->isBookingOpened(); if(false == $opend) { $this->setErrorCode(305); return 0; } $scheduleList = $doctor->space->getSpaceBusinessRequirement4Booking()->serializedSchedule; //约满 $seatLimits = BookingClient::getInstance()->getseatLimitCount( $doctor->space, date('Y-m-d', strtotime("+ 3 day")), date('Y-m-d', strtotime("+ 17 day"))); //停诊 $contract = $doctor->space->getBookingContract(); $stopDiagnose = DAL::get()->find_all_by_spaceid('StopDiagnose', $doctor->space->id); //预告 $notices = BookingClient::getInstance()->getSchedule($contract->id); $bookingOrderCount = PlussignChannelClient::getInstance()->getOrderCount(array($contract->id)); if(empty($bookingOrderCount)) { $bookingOrderCount = 0; }else { foreach($bookingOrderCount as $key => $value) { $bookingOrderCount = $value; } } $info = array(); $mobileSetting = DAL::get()->find_by_keyname('MobileSetting', MobileSetting::KEY_NAME_HOLIDAY_NOTICE_BOOKING); $isShowHolidayNotice = (false == $mobileSetting->isNull() && $mobileSetting->hasHolidayNotice()) ? 1 : 0; $holidayNoticeTitle = ''; if (false == $mobileSetting->isNull() && $mobileSetting->hasHolidayNotice()) { $valueArray = $mobileSetting->value; $holidayNoticeTitle = $valueArray['title']; } $info['isShowHolidayNotice'] = $isShowHolidayNotice; $info['holidayNoticeTitle'] = $holidayNoticeTitle; $spaceBusinessRequirement = $doctor->space->getSpaceBusinessRequirement4Booking(); if($spaceBusinessRequirement->isUpdate()) { $info['disease'] = $spaceBusinessRequirement->updateFrontConfig['disease']; $info['area'] = $spaceBusinessRequirement->updateFrontConfig['area']; } else { $info['disease'] = $spaceBusinessRequirement->disease; $info['area'] = $spaceBusinessRequirement->area; } // $info['oldPatientMsg'] = ''; if($spaceBusinessRequirement->isUpdate()) { if(SpaceBusinessRequirement::PATIENT_FRESH_OLD == $spaceBusinessRequirement->updateFrontConfig['patientFreshness']) { $info['oldPatientStatus'] = 1; $info['oldPatientMsg'] = '仅接受复诊患者的预约'; } else if(SpaceBusinessRequirement::PATIENT_FRESH_NEW == $spaceBusinessRequirement->updateFrontConfig['patientFreshness']) { $info['oldPatientStatus'] = 1; $info['oldPatientMsg'] = '仅接受新患者的预约'; } } else { if(SpaceBusinessRequirement::PATIENT_FRESH_OLD == $spaceBusinessRequirement->patientFreshness) { $info['oldPatientStatus'] = 1; $info['oldPatientMsg'] = '仅接受复诊患者的预约'; } else if(SpaceBusinessRequirement::PATIENT_FRESH_NEW == $spaceBusinessRequirement->patientFreshness) { $info['oldPatientStatus'] = 1; $info['oldPatientMsg'] = '仅接受新患者的预约'; } } $info['finishOrderCount'] = 0 == $bookingOrderCount ? '': $bookingOrderCount; $info['schedule'] = array(); if(!$spaceBusinessRequirement->scheduleIsNull()) { $info['schedule'] = self::rewriteScheduleList($scheduleList, $seatLimits, $stopDiagnose, $notices, $doctor->space); } $i = 0; foreach($info['schedule'] as $schedule) { $info['schedule'][$i]['scheduleInfo'] = strip_tags($schedule['scheduleInfo']); $i++; } $unBookingVisitCnt = BookingClient::getInstance()->getNoReturnVisitOrderCount('bookingorder', $user->id); //未回访订单数量为1个,拿到这一个未回访订单的id $info['bookingOrderId'] = ''; if (isset($unBookingVisitCnt) && $unBookingVisitCnt == 1) { $allBookingOrderList = DAL::get()->find_all_by_userid('bookingorder', $userId); foreach($allBookingOrderList as $bookingOrder) { if ($bookingOrder->isCallBack()) { $orderIds[] = $bookingOrder->id; } } if (isset($orderIds) && count($orderIds) == 1) { $info['bookingOrderId'] = $orderIds[0]; } } $info['unBookingVisitCnt'] = $unBookingVisitCnt; $this->content = $info; }/*}}}*/