private function getPosterInfo($comment, $response) { /*{{{*/ //加号 $response->userCommentCnt = ''; $userName = $comment->getUserName(); $userPhone = $comment->getPosterMobile(); $doctor = $comment->doctor; $spaceId = $doctor->hasSpace() ? $doctor->space->id : 0; $jiaHaoStatus = 0; $userPhoneThreadList = array(); if ($comment->patientId && $spaceId > 0) { $jiaHaoStatus = BookingClient::getInstance()->getPatientBookingStatus($comment->patientId, $spaceId); $userPhoneThreadList = PaymentClient::getInstance()->getPatientSuccessServiceList($comment->patientId, $spaceId); } $response->doctor = $doctor; $response->jiaHaoStatus = $jiaHaoStatus; $response->userPhoneThreadList = $userPhoneThreadList; }
public function postBookingVisitOrder($orderId = 0, $visitIndex = -1, $visitValue = '') {/*{{{*/ $retStatus = BookingOrder::STATUS_PHONE_NO_CALL; if ($orderId > 0 && mb_strlen($visitValue, 'GBK') > 0) { $proposal = DAL::get()->find('proposal', $orderId); if ($proposal->isNull()) { $order = DAL::get()->find('bookingorder', $orderId); } else { $order = array_shift($proposal->getExecutions()); } if ($order->isNull() || false == $order->isCallBack()) { $this->setErrorCode(903); return 0; } $params = array(); $params['id'] = $order->id; $params['visitRemark'] = trim('自助回访:'.mb_substr($visitValue, 0, 200, 'gbk')); $params['option'] = $visitIndex; //表示选的是哪一项index? $retStatus = BookingClient::getInstance()->updateVisitRemark($params); } }/*}}}*/
public function xinZang($request, $response) {/*{{{*/ $hospitalFacultyIds = $this->getXinZangHospitalFacultyId(); $allHospitalFacultyIds = $this->getAllHospitalFacultyIds(); $allHospitalFaculty = DAL::get()->find('hospitalfaculty', $allHospitalFacultyIds); $openBookingCount = PlussignChannelClient::getInstance()->getBookingCount($allHospitalFacultyIds); //=====右边=====心血管疾病 看病指南 $xinZangTags = DAL::get()->find_by_keyword('cmstag', 'xinzang'); $xinZangCount = array(); $tagCount = array(); if(empty($xinZangTags) == false) { foreach($xinZangTags->children as $tags) { foreach($tags->children as $tag) { $tagCount[$tag->name] = count($tag->cmstaglinkref); } $xinZangCount[$tags->name] = array_sum($tagCount); } } $facultyName = array('心血管内科', '心血管外科', '小儿心内科', '小儿心外科'); $openCaseDoctorCount = DoctorClient::getInstance()->getOpenCaseDoctorCount(); $openBookingDoctorCount = BookingClient::getInstance()->getOpenBookingDoctorCount('', $facultyName); $successBookingOrderTotalCount = BookingClient::getInstance()->getSuccessBookingOrderCount(); //取符合条件的医生spaceId $spaceIdList = PlussignChannelClient::getInstance()->getXinZangBookingSpaceIds(); //随机取8个 shuffle($spaceIdList); $spaceIds = array_slice($spaceIdList, 0, 8); $spaces = array(); $successBookingCount = 0; if(empty($spaceIds) == false){ $spaces = DAL::get()->find('space', $spaceIds); //一个医生的加号成功条数 $successBookingCount = PlussignChannelClient::getInstance()->getXinZangBookingCount($spaceIds); } $response->hospitalFacultyIds = $hospitalFacultyIds; $response->allHospitalFacultyIds = $allHospitalFacultyIds; $response->allHospitalFaculty = $allHospitalFaculty; $response->openBookingCount = $openBookingCount; $response->xinZangCount = $xinZangCount; $response->openCaseDoctorCount = $openCaseDoctorCount; $response->openBookingDoctorCount = $openBookingDoctorCount; $response->successBookingOrderTotalCount = $successBookingOrderTotalCount; $response->spaces = $spaces; $response->successBookingCount = $successBookingCount; $response->type = 'xinzang'; //返回页面类型,暂时用于控制二级导航 }/*}}}*/
/** * breakBookingOrder * 医生判断爽约 * @param mixed $userId * @param mixed $bookingOrderId * @access public * @return void */ public function breakBookingOrder($userId, $bookingOrderId) {/*{{{*/ $space = DAL::get()->find('space', $userId); $res = $this->checkSpace($space); if($res) { $this->setErrorCode($res); return 0; } $order = DAL::get()->find('BookingOrder', $bookingOrderId); if ($order->isNull()) { $this->setErrorCode(158); return 0; } BookingClient::getInstance()->doSpaceVisitTagNo($bookingOrderId); $this->content = array('id'=>$userId); }/*}}}*/
private function formatHospitalFaculty($hospitalFacultyList) {/*{{{*/ $hfArray = array(); $b = 1; foreach($hospitalFacultyList as $hospitalFaculty) { $hfArray[$b]['hfInfo']['num'] = $b; $hfArray[$b]['hfInfo']['offcategory'] = $hospitalFaculty->faculty->parentName; $hfArray[$b]['hfInfo']['officename'] = $hospitalFaculty->name; $hfArray[$b]['hfInfo']['officesite'] = ''; $hfArray[$b]['hfInfo']['officeintro'] = empty($hospitalFaculty->intro) ? '' : trim(strip_tags(XString::truncate($hospitalFaculty->intro, 160))); $hfArray[$b]['hfInfo']['officetel'] = empty($hospitalFaculty->phone) ? '' : $hospitalFaculty->phone; $openBookingCount = BookingClient::getInstance()->getOpenBookingDoctorCount($hospitalFaculty->hospital->id, $hospitalFaculty->faculty->name); if($openBookingCount > 0) { $bookingUrl = "http://jiahao.haodf.com/".rawurlencode(Area::getProvKeyByName4PlussignChannel($hospitalFaculty->hospital->province))."/hospitalfaculty/".rawurlencode($hospitalFaculty->hospital->id)."/".rawurlencode($hospitalFaculty->faculty->id).".htm"; } $hfArray[$b]['hfInfo']['officeorder'] = isset($bookingUrl) ? $bookingUrl : ''; $offdiagscope = $this->getoffdiagscope($hospitalFaculty->id); $hfArray[$b]['hfInfo']['offdiagscope'] = $offdiagscope; $hfArray[$b]['hfInfo']['offdocnum'] = $hospitalFaculty->doctorCount; $hfArray[$b]['hfInfo']['offurl'] = $hospitalFaculty->getUrl(); $b++; BeanFinder::get('LocalCache')->removeAll(); } return $hfArray; }/*}}}*/
<th width='10%'>医生(级别)</th> <th width='18%'>医院科室</th> <th width='6%'>医生类型</th> <th width='16%'>患者要求</th> <th width='9%'>地区要求</th> <th width='9%'>加号人数</th> <th width='9%'>医生生效执行单数</th> <th width='15%'>是否医生确认</th> <th width='9%'>操作</th> </tr> </table> </div> <table class="detail-table fontcolor"> <?php foreach($doctors as $doctor) { $bookingOrderCnt = BookingClient::getInstance()->countDoctorOrder('BookingOrder', $doctor->space->id); $spacebusinessrequirement = DAL::get()->find_by_spaceid('spacebusinessrequirement',$doctor->space->id); $doctormark = DAL::get()->find_by_doctorid('doctormark', $doctor->getPrimaryDoctor()->id); $doctorTypeDesc = ''; if(false == $doctormark->isNull()) { $isUnusual = $doctormark->isOverPublicize() || $doctormark->isReplyQualityBad() || $doctormark->isActivityAbnormal(); $doctorType = $doctormark->getDoctorType(); if($doctormark->isNewBooking() || $doctormark->isProjectBooking() || $doctormark->isPayDoctor()) { $doctorTypeDesc = DoctorMark::$doctorTypeDesc[$doctorType]; } } else { $isUnusual = false;
public function bookingordertipsinfo($request,$response) {/*{{{*/ $retVisitCount = BookingClient::getInstance()->getNoReturnVisitOrderCount('bookingorder', $this->_newUser->id); $retVisitCount = empty($retVisitCount)?0:$retVisitCount; $response->noretvisitcount = $retVisitCount; $response->user = $this->_newUser; $response->transfer = $request->transfer; $verify = $this->_verifyKey($request->transfer); $response->verify = $verify; if(!$retVisitCount){ $response->setRedirect($this->_newSpace->getUrl().'booking/orderform?verify='.$verify.'&transfer='.urlencode($request->transfer) ); } }/*}}}*/
public function newBookingDoctorList4msn($request,$response) { $response->bookingContractList = BookingClient::getInstance()->getNewBookingContractList(); }
public function getHospitalFacultyListByHospitalIdAndDiseaseKey($hospitalId, $diseaseKey) {/*{{{*/ $disease = DAL::get()->find_by_fld_DiseaseKey('Disease', $diseaseKey); if($disease->isNull()) { $this->setErrorCode(136); return 0; } $facultyList = DiseaseClient::getInstance()->getDiseaseHospitalFacultyByHospitalWithDisease($hospitalId,$disease->id,400); if(empty($facultyList)) { $this->setErrorCode(165); return 0; } $recommendFacultyDoctorInfos = array(); foreach($facultyList as $faculty) { $recommendFacultyDoctorInfo['hospitalFacultyId'] = $faculty['id']; $hospitalFaculty = DAL::get()->find('hospitalFaculty', $faculty['id']); $recommendFacultyDoctorInfo['hospitalFacultyName'] = $faculty['facultyname']; //todo 优化 $tmpDiseaseDoctorList = DiseaseClient::getInstance()->getDiseaseDoctorByHospitalWithFaculty($hospitalId, $disease->voteDisease->id, $faculty['id'],array('nowPage' => 1, 'pageSize' => 3,'whereFacultyId'=>$faculty['id'])); $recommendFacultyDoctorInfo['recommendDoctorCount'] = $tmpDiseaseDoctorList['pageInfo']['total']; $recommendFacultyDoctorInfo['caseDoctorCount'] = $hospitalFaculty->spaceCount; $recommendFacultyDoctorInfo['bookingDoctorCount'] = (int)(BookingClient::getInstance()->getOpenBookingDoctorCount($hospitalFaculty->hospital->id, $hospitalFaculty->faculty->name)); $recommendName = array(); $diseaseDoctors = $tmpDiseaseDoctorList['list']; foreach($diseaseDoctors as $diseaseDoctor) { $recommendName[] = $diseaseDoctor->doctor->name; } $recommendDoctorNames = self::_getTheDoctors($recommendName); $recommendFacultyDoctorInfo['recommendDoctorNames'] = $recommendDoctorNames; $recommendFacultyDoctorInfos[] = $recommendFacultyDoctorInfo; } $this->content = $recommendFacultyDoctorInfos; }/*}}}*/
public function loadMoreBooking($request, $response) {/*{{{*/ $this->initialize($request, $response); $nowPage = $request->getRequest('p', 1); $totalBookingCnt = 0; $bookingOrderList = array(); $res = BookingClient::getInstance()->getFinishOrderList4Space($this->space->id, $nowPage,self::PAGESIZE_BOOKING); $bookingOrderList = $res['list']; $totalBookingCnt = isset($res['pageInfo']['total']) ? $res['pageInfo']['total'] : 0; $response->pages = $res['pageInfo']['pages']; $response->nowPage = $nowPage; $response->loadUrl = $response->touchUrl.'/doctor/loadmorebooking?id='.$request->id.'&p='; $response->totalBookingCnt = $totalBookingCnt; $response->bookingOrderList = $bookingOrderList; }/*}}}*/
private function getBookingInfo($diseaseFaculty, $response) {/*{{{*/ $faculty = $diseaseFaculty->faculty; $response->faculty = $faculty; $phoneDoctorIds = DAL::get()->queryDoctorIdsByFaculty('DoctorOutLine', $faculty->id, 3); $phoneServices = $topPhoneDoctor = array(); if (false == empty($phoneDoctorIds)) { $topPhoneDoctor = DAL::get()->find('Doctor', $phoneDoctorIds); $phoneServices = PaymentClient::getInstance()->getDoctorSatisfactionList($phoneDoctorIds); } $phoneDoctorCount = DoctorClient::getInstance()->getIsPhoneServiceOpenedDoctorCount($faculty); $response->topPhoneDoctor = $topPhoneDoctor; $servicePayInfo = array(); foreach($phoneServices as $phoneService) { // 解决 ARK-7955 $servicePayInfo[] = $phoneService; } $response->phoneServices = $servicePayInfo; $response->phoneDoctorCount = $phoneDoctorCount; $faculty = $diseaseFaculty->faculty; //预约加号 $spaceIds = PlussignChannelClient::getInstance()->getDoctorListByFaculty($faculty); $successOrderCount = PlussignChannelClient::getInstance()->getOrderCntOfSpaces($spaceIds); $bookingContractCount = BookingClient::getInstance()->getDoctorTotalCountByFaculty('bookingorder', $faculty); $response->bookingSpaces = DAL::get()->find('Space', $spaceIds); $response->successOrderCount = $successOrderCount; $response->bookingContractCount = $bookingContractCount; }/*}}}*/
private function getDoctorCount($request, $response) {/*{{{*/ //开通加号 $response->openBookingCount = BookingClient::getInstance()->getOpenBookingDoctorCount($this->hospitalFaculty->hospital->id, $this->hospitalFaculty->faculty->name); //所有 $response->allCount = $this->hospitalFaculty->doctorCount; }/*}}}*/
<?php define('_MEXEC', 'OK'); require_once "../../../system/load.php"; include '../../../config/config.php'; $dateTime = new DateTime("now", new DateTimeZone('Asia/Colombo')); $submitted_date = $dateTime->format("Y-m-d H:i:s"); $currentDate = date("F j, Y, g:i a"); $mainCity = new MainCity(); $SubCity = new SubCity(); $hotels = new Hotels(); $session = new Sessions(); //$mail = new SystemMail(); $reservations = new Reservations(); $bookingclient = new BookingClient(); $rooms = new HotelRoomType(); $merchantReferenceNo = $session->getMerchantReferenceNo(); $reservations->setReservationId($merchantReferenceNo); $pay_data = $reservations->getReservationsFromId(); $reservations->extractor($pay_data); $reservation_link_id = $reservations->reservationFromBookingLink(); $reservations_status = $reservations->reservationPaymentStatus(); $hotels->setHotelId($reservations->reservationHotelId()); $hotels->extractor($hotels->getHotelFromId()); $date = date("Y-m-d"); // current date $new_date = strtotime(date("Y-m-d", strtotime($date)) . " +3 month"); $expire_date = date("Y-m-d", $new_date); $bookingclient->setId($reservations->reservationClientId()); $bookingclient->extractor($bookingclient->getClientsFromId()); $country = new country();
$client_mobile = ""; $client_email = ""; $client_message = ""; $client_city = ""; $client_country = ""; $client_address = ""; $rooms = new HotelRoomType(); $merchantReferenceNo = $merchantReferenceNo; $reservations->setReservationId($merchantReferenceNo); $pay_data = $reservations->getReservationsFromId(); $pay_data = $reservations->getReservationsFromId(); $reservations->extractor($pay_data); $reservation_link_id = $reservations->reservationFromBookingLink(); $reservations_status = $reservations->reservationPaymentStatus(); if ($reservations->reservationFromBookingLink()) { $client = new BookingClient(); $client->setId($reservations->reservationClientId()); $client->extractor($client->getClientsFromId()); $client_name = $client->name(); $client_mobile = $client->contactno(); $client_email = $client->email(); $client_message = $client->message(); $client_city = $client->city(); $client_country = $client->country(); $client_address = $client->address1() . " " . $client->address2(); } else { $client = new Clients(); $client->setClientId($reservations->reservationClientId()); $client->extractor($client->getClientFromId()); $client_name = $client->clientFirstName() . " " . $client->clientLastName(); $client_mobile = $client->clientPhoneMobile();
private function _getBookingCounts($spaceIds) {/*{{{*/ $bookingCnts = BookingClient::getInstance()->getFinishBookingCntBySpaces($spaceIds); return $bookingCnts; }/*}}}*/
$reservations->setReservationId($merchantReferenceNo); $reservations->setReservationPaymentStatus(1); $reservations->updateReservationsOnlinePayment(); $trans_msg = "Transaction Successful"; }else{ $reservations->setReservationId($merchantReferenceNo); $reservations->setReservationPaymentStatus(0); $reservations->updateReservationsOnlinePayment(); $trans_msg = "Transaction unsuccessful, please try again"; }*/ $reservations->setReservationId($merchantReferenceNo); $pay_data = $reservations->getReservationsFromId(); $reservations->extractor($pay_data); $reservation_link_id = $reservations->reservationFromBookingLink(); $reservations_status = $reservations->reservationPaymentStatus(); $bookingclient = new BookingClient(); $bookingclient->setId($reservations->reservationClientId()); $bookingclient->extractor($bookingclient->getClientsFromId()); ?> <!DOCTYPE html> <!--[if lt IE 7]> <html dir="ltr" lang="en-US" class="ie6"> <![endif]--> <!--[if IE 7]> <html dir="ltr" lang="en-US" class="ie7"> <![endif]--> <!--[if IE 8]> <html dir="ltr" lang="en-US" class="ie8"> <![endif]--> <!--[if gt IE 8]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]--> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Reservation</title>
public function cancelOrder($request, $response) { /*{{{*/ $ref = DAL::get()->find('DoctorPatientRef', $request->refid); if ($ref->isNull()) { header('Location: ' . $this->space->getUrl()); return; } DBC::requireNotEmptyString($request->id, '您要查看的订单不存在'); BookingClient::getInstance()->userCancleOrder($this->user, $request->id); $response->setRedirect($ref->url); }
$hotels = new Hotels(); $reservations = new Reservations(); $merchantReferenceNo = $_REQUEST['resid']; $reservations->setReservationId($merchantReferenceNo); $pay_data = $reservations->getReservationsFromId(); $reservations->extractor($pay_data); $reservation_link_id = $reservations->reservationFromBookingLink(); $reservations_status = $reservations->reservationPaymentStatus(); $hotels->setHotelId($reservations->reservationHotelId()); $hotels->extractor($hotels->getHotelFromId()); $hotels_id = $reservations->reservationHotelId(); $bookingclient = new BookingClient(); $bookingclient->setId($reservations->reservationClientId()); $bookingclient->extractor($bookingclient->getClientsFromId()); ?> <!DOCTYPE html> <!--[if lt IE 7]> <html dir="ltr" lang="en-US" class="ie6"> <![endif]--> <!--[if IE 7]> <html dir="ltr" lang="en-US" class="ie7"> <![endif]--> <!--[if IE 8]> <html dir="ltr" lang="en-US" class="ie8"> <![endif]--> <!--[if gt IE 8]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]--> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
public function disease($request, $response) {/*{{{*/ //for seo if ($this->needRedirect($request, $response)) { return; } $disease = DAL::get()->find_by_fld_DiseaseKey('Disease', $request->disease_key); if ($disease->isNull()) $this->_exit404(); //若科室非空,则转到科室疾病页 $facultyId = $request->getRequest('faculty_id', 0); if ($facultyId) { $facultyId = Codec::getInstance()->decodeId($facultyId); } $response->faculty_id = (!empty($facultyId))?(Codec::getInstance()->encodeId($facultyId)):0; //var_dump($response->faculty_id);exit; //by yxy:获得该疾病下的的票最多的4个科室id及第一页的专家列表名单 $facultyVoteTop4 = DiseaseClient::getInstance()->getDiseaseHospitalFacultyByHospitalWithDisease($this->_hospital->id,$disease->id,4); $response->facultyVoteTop4 = $facultyVoteTop4; $inFlag = 0; foreach($facultyVoteTop4 as $facultyList){ if(trim($facultyList['id']) == trim($facultyId)){ $inFlag = 1; break; } } if(false == empty($facultyId)){ $hospitalFaculty = DAL::get()->find('HospitalFaculty',$facultyId); if($hospitalFaculty->isNull()) { $this->_exit404(); } $response->faculty_name=$hospitalFaculty->name; $diseaseHospital = DAL::get()->find_by_condition('DiseaseHospitalFaculty', "fld_DiseaseId={$disease->voteDisease->id} and fld_HospitalFacultyId='{$facultyId}'"); $diseaseHospitalFaculty = $diseaseHospital; //如果从科室首页来的疾病不在这4个科室中,则将该科室放在第一位,同时删除最后一个 if(!$inFlag){ $newFacultyVoteTop4[] = array('id'=>$facultyId,'facultyname'=>$hospitalFaculty->name); foreach ($facultyVoteTop4 as $facultyList){ $newFacultyVoteTop4[] = $facultyList; } if(count($newFacultyVoteTop4)>4) //去掉最后一个元素 array_pop($newFacultyVoteTop4); $response->facultyVoteTop4 = $newFacultyVoteTop4; //替换新的科室排名 } $this->getSidePhoneServiceListByHF($hospitalFaculty, $response); }else{ $diseaseHospital = DAL::get()->find_by_condition('DiseaseHospital', "fld_DiseaseId={$disease->voteDisease->id} and fld_HospitalId={$this->_hospital->id}"); } $response->diseaseHospital = $diseaseHospital; $response->hospitalid = Codec::getInstance()->encodeId($this->_hospital->id); $response->disease_key= $request->disease_key; if ($facultyId) { $tmpDiseaseDoctorList = DiseaseClient::getInstance() ->getDiseaseDoctorByHospitalWithFaculty($this->_hospital->id, $disease->voteDisease->id, $facultyId, array('nowPage' => $this->_p, 'pageSize' => self::DISEASE_PAGE_SIZE,'whereFacultyId'=>$facultyId)); } else { $tmpDiseaseDoctorList = DiseaseClient::getInstance() ->getDiseaseDoctorByHospital($this->_hospital->id, $disease->voteDisease->id, array('nowPage' => $this->_p, 'pageSize' => self::DISEASE_PAGE_SIZE)); } $response->diseaseDoctorList = $tmpDiseaseDoctorList['list']; $pageInfo = $tmpDiseaseDoctorList['pageInfo']; $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate( "?hospital_id={$this->_hospital->id}&disease_key={$disease->key}&faculty_id={$request->faculty_id}&p="), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']); $this->getSidePhoneServiceListByHospital($response); //---- side doctor ---- //推荐医院(更多好评医院), 按两周回复数排 /* $params = array(); $params['diseaseId'] = $disease->voteDisease->id; $params['limit'] = self::SIDE_DISEASE_HOSPITAL_NUM; $params['facultyId'] = $response->faculty_id; $hospitalAndFaculty = SpaceClient::getInstance()->getTriageDiseaseHospital($this->curUser, $params, true); $response->diseaseHospitalList = $hospitalAndFaculty['diseaseHospitalList']; $response->diseaseHospitalListCount = self::SIDE_DISEASE_HOSPITAL_NUM; */ // ---- 更多好评医生 , 推荐医生 ---- /* $latestOnlineDiseaseDoctors = array(); $doctorList2 = DiseaseClient::getInstance()->getDieaseDoctor($params['diseaseId'], array(), $params['limit']); $response->otherDoctorList = $doctorList2; $response->latestOnlineDiseaseDoctors = $doctorList2; $response->latestOnlineDiseaseDoctorsCount = self::SIDE_DISEASE_DOCTOR_NUM; $params = array(); $page = array(); $params['hospitalId'] = $this->_hospital->id; $params['diseaseId'] = $disease->id; $params['limit'] = 5; $params['postcount'] = 0; $tmpDoctorUserList = SpaceClient::getInstance()->getLatestOnlineSpaceList($params); $doctorUserList = $tmpDoctorUserList['spaceList']; $response->spacePostCntInfos = $tmpDoctorUserList['postcount']; $doctorUserNotice = ''; if (empty($doctorUserList)) $doctorUserNotice = $this->_hospital->commonName." 目前没有 " .$disease->name." 方向的医生提供咨询服务,您可以咨询同专业其他大夫:"; $response->doctorUserList = $doctorUserList; $response->doctorUserNotice = $doctorUserNotice; */ $descDiseaseDoctorList = $tmpDiseaseDoctorList['list']; //取开通加号医生 $spaceIds = array(); foreach($tmpDiseaseDoctorList['list'] as $tmpDiseaseDoctorList) { if($tmpDiseaseDoctorList->doctor->hasSpace()) $spaceIds[] = $tmpDiseaseDoctorList->doctor->space->id; } $bookingList = array(); $spaceIds = array_filter($spaceIds); if (empty($spaceIds) == false){ $bookingList = BookingClient::getInstance()->getContractIds($spaceIds); } $response->bookingList = $bookingList; $response->p = $this->_p; $response->disease = $disease; $response->similarDisease = $disease; $response->pageModule = 'disease'; //获取描述,列出投票前三的医生 $descDiseaseDoctorList = array_slice($descDiseaseDoctorList,0,3); $descDiseaseDoctorInfo = array(); foreach ($descDiseaseDoctorList as $descDiseaseDoctor) { $descDiseaseDoctorInfo[] = $descDiseaseDoctor->doctor->name.",".$disease->name."得票".$descDiseaseDoctor->doctor->goodVoteCount."票"; } $keywords = ""; if(!isset($facultyId) || empty($facultyId)){ $description = $this->_hospital->commonName.$disease->name."推荐专家,共" .$diseaseHospital->doctorCount."位,总得票".$diseaseHospital->rate1Count."票。".implode(';', $descDiseaseDoctorInfo); $title = $this->_hospital->commonName.'治疗'.$disease->name.'推荐专家_好大夫在线'; if($this->_p != 1) { $title = $this->_hospital->commonName.$disease->name."专家_好大夫推荐专家第".$this->_p."页_好大夫在线"; $description = ""; $keywords = ""; } }else{ $description = $this->_hospital->commonName.$disease->name."专家(".$hospitalFaculty->name."),共" .$diseaseHospital->doctorCount."位,总得".$diseaseHospital->rate1Count."票。".$diseaseHospitalFaculty->doctorCount."位".$this->_hospital->commonName.$hospitalFaculty->name.$disease->name."专家在线咨询,".implode(';', $descDiseaseDoctorInfo); $title = $this->_hospital->commonName.$disease->name.'专家、大夫_'.$hospitalFaculty->name.'_好大夫在线'; $keywords = $this->_hospital->commonName.$disease->name.'专家,'. $this->_hospital->commonName.$disease->name.'大夫。'; } $response->title = $title; $response->keywords = $keywords; $response->description = $description; }/*}}}*/
public function pass($request, $response) { $id = $request->orderid; $doctortype = $request->doctortype; if ($doctortype != SpaceBusinessRequirement::DOCTOR_IS_IMPORTANT && $doctortype != SpaceBusinessRequirement::DOCTOR_NO_IMPORTANT) { throw new BizException('doctortype不合法'); } BookingClient::getInstance()->waitRunBookingOrder($this->curInspector->user, $id); $orderId = BookingClient::getInstance()->getNextBookingOrder($this->curInspector->id, $doctortype); if ($orderId) { $response->setRedirect('showorderdetail?orderId=' . $orderId . '&doctortype=' . $doctortype); } else { echo "审核结束"; return parent::DIRECT_OUTPUT; } }
public function applyBookingPost($request, $response) { /*{{{*/ $params['disease'] = $request->disease; $params['userCategory'] = $request->userCategory; $params['seatLimit'] = $request->seatLimit; $params['isProxy'] = $request->isProxy; $params['schedule'] = $request->schedule; $params['area'] = $request->area; $params['address'] = $request->address; $params['doctorRemark'] = $request->doctorRemark; $newMobile = $request->mobile; $spaceId = $request->spaceId; $space = DAL::get()->find('Space', $spaceId); BookingClient::getInstance()->createContract($space, $params, $newMobile); echo '申请开通加号成功'; return parent::DIRECT_OUTPUT; }
private function getPodRelatedInfo($pod, $response) {/*{{{*/ $podrefs = $pod->podpatientref; $patientIds = array(); foreach($podrefs as $podref) { $userNames[] = $podref->patient->user->name; $flows[] = DAL::get()->find_by_spaceid_and_patientid('doctorpatientref', $podref->pod->space->id, $podref->patient->id); $patientIds[] = $podref->patient->id; } $userNames = array_filter($userNames); $userName = implode(',', $userNames); $response->userName = $userName; $response->flows = $flows; $flow = FlowClient::getInstance()->getFirstIstreateFlow($pod->space->id, $patientIds); $response->treatedTime = $flow->treatedTime->toShortString(); $phoneServiceInfo = TelOwnerClient::getInstance()->getPhoneServiceCnt('telorder', $patientIds, $pod->space->id); $response->phoneServiceCnt = $phoneServiceInfo[0]['cnt']; $response->phoneServiceCtime = $phoneServiceInfo[0]['ctime']; $bookingOrderInfo = BookingClient::getInstance()->getBookingOrderCntByPodref('bookingorder', $pod->space->id, $patientIds); $response->bookingOrderCnt = $bookingOrderInfo[0]['cnt']; $response->bookingOrderCtime = $bookingOrderInfo[0]['ctime']; $response->regroups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($patientIds, $pod->space->id); }/*}}}*/
private function _spaceInfo(Space $space, $response) { /*{{{*/ $owner = $space->user->getTelOwner(); $response->_spaceInfo_space = $space; $response->_spaceInfo_spaceBR = $space->getSpaceBusinessRequirement4Booking(); $response->_spaceInfo_spaceExt = DAL::get()->find_by_spaceid('SpaceExt', $space->id); $response->_spaceInfo_total = DAL::get()->queryTotalFlowProposalCntOfSpace('proposal', $space); $response->_spaceInfo_bookingOrderCnt = BookingClient::getInstance()->countDoctorOrder('BookingOrder', $space->id); $response->_spaceInfo_doctorPhoneSchedules = TelOwnerClient::getInstance()->getDoctorPhoneScheduleByOwnerId($owner->id); }
private function getBookingCount($request, $response) { /*{{{*/ $response->bookingOrderCount = PlussignChannelClient::getInstance()->getOrderCount(array($this->space->getBookingContract()->id)); if ($this->isSpaceLogin()) { $orderList1 = BookingClient::getInstance()->getOrderList4Doctor($this->space->user->id, 'pending'); $orderList2 = BookingClient::getInstance()->getOrderList4Doctor($this->space->user->id, 'confirmed'); $orderCount = BookingClient::getInstance()->getOrderListCount4Doctor($this->space->user->id); $response->orderCount = $orderCount; $response->orderList = array_merge($orderList1, $orderList2); } }
public function showDoctorList($request, $response) { /*{{{*/ $params = array(); $unbinddisease = $request->unbinddisease; //$status = $this->getRequirementStatus($request,$response); $status = $request->auditstatus; $hospitalName = $request->hospitalName; $facultyName = $request->facultyName; $doctorName = $request->doctorName; $isProxy = $request->isProxy; //分页 $request->page = $request->page ? $request->page : 1; $pageSize = 30; $params = array('unbinddisease' => $unbinddisease, 'status' => $status, 'hospitalName' => trim($hospitalName), 'facultyName' => trim($facultyName), 'doctorName' => trim($doctorName), 'isProxy' => $isProxy); $res = SpaceBusinessRequirementClient::getInstance()->getSpaceBusinessRequirementList(ServiceDef::TYPE_BOOKING, $request->page, $pageSize, $params); if (false == empty($res['pageInfo'])) { $pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("/spacebusinessrequirement/showdoctorlist?showContent=1&hospitalName={$hospitalName}&facultyName={$facultyName}&doctorName={$doctorName}&auditstatus={$request->auditstatus}&isProxy={$isProxy}&unbinddisease={$unbinddisease}&page="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']); } $spaceBusinessRequirementList = $res['list']; $doctorIds = array(); foreach ($spaceBusinessRequirementList as $require) { $doctorIds[] = $require->space->host->id; } $doctorRefCntInfos = array(); if (empty($doctorIds) == false) { $doctorRefCntInfos = BookingClient::getInstance()->getRefCountByDoctorIds('BookingDoctorDiseaseRef', $doctorIds); } $response->params = $params; $response->spaceBusinessRequirementList = $spaceBusinessRequirementList; $response->pagelink = $pagelink; $response->doctorRefCntInfos = $doctorRefCntInfos; }
private function getRealData($hospital) {/*{{{*/ $display = array(); if($hospital instanceof hospital) { $hfList = $this->getHospitalFacultyInfo($hospital->id); //获取经纬度 ,只取有经纬度的数据 $coordinate = $this->getCoordinate($hospital); if(!$coordinate) { return array(); } $display['id'] = 'haodaifu_'.$hospital->id.rand(100,999); $id++; $display['name'] = $hospital->name; //address $display['address'] = $this->getAddress($hospital->address); //aliases $aliasesArr = $this->explodeComma($hospital->aliases); if($aliasesArr) { foreach($aliasesArr as $alias) { $display[]['aliasesform']['alias'] = $alias; } } else { $display[]['aliasesform']['alias'] = ''; } //phone $phoneArr = $this->explodeComma($hospital->phone); if($phoneArr) { foreach($phoneArr as $phone) { $clearPhone = preg_replace('/\(.*\)/', '', $phone); $display[]['phoneform']['phone'] = $clearPhone; } } else { $display[]['phoneform']['phone'] = ''; } //neike if($hfList['neike']) { //$neikeArr = $this->explodeComma($hfList['neike']); foreach( $hfList['neike'] as $name) { $display[]['neikeform']['neike'] = $name; } } else { $display[]['neikeform']['neike'] = ''; } //waike if($hfList['waike']) { foreach($hfList['waike'] as $name) { $display[]['waikeform']['waike'] = $name; } } else { $display[]['waikeform']['waike'] = ''; } //fuerke if($hfList['fuerke']) { foreach($hfList['fuerke'] as $name) { $display[]['fuerkeform']['fuerke'] = $name; } } else { $display[]['fuerkeform']['fuerke'] = ''; } //zhongyike if($hfList['zhongyike']) { foreach($hfList['zhongyike'] as $name) { $display[]['zhongyiform']['zhongyike'] = $name; } } else { $display[]['zhongyiform']['zhongyike'] = ''; } //qita if($hfList['qita']) { foreach($hfList['qita'] as $name) { $display[]['qitaform']['qita'] = $name; } } else { $display[]['qitaform']['qita'] = ''; } $display['longtitude'] = $coordinate['longtitude']; //经度 $display['latitude'] = $coordinate['latitude']; //纬度 $display['homepage'] = $hospital->getUrl(); $display['hospital_degree'] = Hospital::$GradeDefine[$hospital->grade]; $display['consultation_url'] = $hospital->getDoctorUrl(); $display['referral_appointment'] = $hospital->getJiaHaoUrl(); $display['description'] = trim(strip_tags(XString::truncate($hospital->intro, 300))); $display['department_category_url'] = $hospital->getUrl(); $display['expertsurl'] = $hospital->getDiseaseUrl(); $display['city'] = $hospital->city; $display['county'] = $hospital->district; $display['reservationcount'] = BookingClient::getInstance()->getSuccessBookingCountByHospital($hospital->id); BeanFinder::get('LocalCache')->removeAll(); } return $display; }/*}}}*/
$hotels = new Hotels(); $session = new Sessions(); $reservations = new Reservations(); $bookingclient = new BookingClient(); $bookingclient = new BookingClient(); $rooms = new HotelRoomType(); $client; $merchantReferenceNo = $_REQUEST['resid']; //$session->getMerchantReferenceNo(); $reservations->setReservationId($merchantReferenceNo); $pay_data = $reservations->getReservationsFromId(); $reservations->extractor($pay_data); $reservation_link_id = $reservations->reservationFromBookingLink(); $reservations_status = $reservations->reservationPaymentStatus(); if ($reservations->reservationFromBookingLink()) { $client = new BookingClient(); $client->setId($reservations->reservationClientId()); $client->extractor($client->getClientsFromId()); $client_name = $client->name(); $client_email = $client->email(); } else { $client = new Clients(); $client->setClientId($reservations->reservationClientId()); $client->extractor($client->getClientFromId()); $client_name = $client->clientFirstName() . " " . $client->clientLastName(); $client_email = $client->clientEmail(); } $hotels->setHotelId($reservations->reservationHotelId()); $hotels->extractor($hotels->getHotelFromId()); $date = date("Y-m-d"); // current date
public function diseaseDoctor($request, $response) {/*{{{*/ $this->initialize($request, $response); $response->provinceName = $this->provinceName; $diseaseId = $this->disease->voteDisease->id; $condition = $this->getCondition4Rank(); $disease = DAL::get()->find('disease', $diseaseId); $res = DiseaseClient::getInstance()->getDieaseDoctor4Disease($disease->id, $this->nowPage, self::PAGESIZE, $condition); $pageLink = PageNav::getNavLink(PageNav::getBaiduappPageNavTemplate("/baiduapp/diseasedoctor/".$this->key.".htm?orderby=".$this->orderby."&province=".$this->province."&p=", 1, 5, 1, true, false, false, ''),$res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']); $response->pageLink = $pageLink; $response->total = $res['pageInfo']['total']; $response->totalPages = $res['pageInfo']['pages']; $doctorList2 = $res['diseaseDoctorList']; $doctorList = $spaceList = array(); foreach($doctorList2 as $doctor2) { if ($doctor2->isNull()) { continue; } else { $spaceList[] = $doctor2->doctor->space; $doctorList[] = $doctor2->doctor; $doctorIds[] = $doctor2->doctor->id; } } $goodVoteCount = 0; if ($doctorIds && $diseaseId) { $goodVoteCount = DoctorClient::getInstance()->getDiseaseDoctorGoodVoteCount($doctorIds, $diseaseId); } $response->goodVoteCount = $goodVoteCount; $spaceIds = array(); foreach($spaceList as $space) { if($space->isNull() == false && $space->id > 0) $spaceIds[] = $space->id; } $tmpResults = array(); if(empty($spaceIds) == false){ $tmpResults = SpaceClient::getInstance()->getTmpSpacePostCnt($spaceIds); } $spacePostCntInfos = array(); foreach($tmpResults as $tmpResult){ $spacePostCntInfos[$tmpResult['userid']] = $tmpResult['postcount']; } $response->spacePostCntInfos = $spacePostCntInfos; $bookingList = array(); if (empty($spaceIds) == false){ $bookingList = BookingClient::getInstance()->getContractIds($spaceIds); } $response->bookingList = $bookingList; $response->doctorList = $doctorList; $response->diseaseId = $this->disease->id; $response->dName4Encode = urlencode($this->disease->name); $response->provinceList = $this->provinceList; $response->voteDisplayLimit = self::VOTE_DISPLAY_LIMIT; }/*}}}*/
public function getUserInfo4NewIndex($userId) {/*{{{*/ $doctorOwner = DAL::get()->find_by_userid('DoctorOwner', $userId); if($doctorOwner->isNull()) { $this->setErrorCode(819); return 0; } $infos = array(); $infos['userName'] = $doctorOwner->source->user->name; $infos['hostName'] = $doctorOwner->source->name; $infos['userRole'] = $this->getUserRole($doctorOwner->user); $infos['isFollowupOpened'] = 2; $infos['headImage'] = ($doctorOwner->isSpace()) ? $doctorOwner->source->getHeadImg4Modify() : $doctorOwner->source->getHeadImage(); $infos['bigHeadImage'] = ($doctorOwner->isSpace()) ? $doctorOwner->source->getHeadImg4Modify(2400) : $doctorOwner->source->getHeadImage(2400); if($doctorOwner->isSpace()) { $space = $doctorOwner->source; $infos['spaceId'] = $space->id; list($featAmount, $heartImgCnt) = ScoreClient::getInstance()->getHeartInfoById($space->id); $infos['featAmount'] = $featAmount; $infos['heartImgCnt'] = $this->getFlagCnt($heartImgCnt); $count = count(BookingClient::getInstance()->getOrderList4Doctor($space->id, self::STATUS_TODAY)); if(false == $space->isBookingOpened()) { $count = 0; } $infos['bookingCnt'] = $count; $telOwner = DAL::get()->find_by_relatedObject('telowner', $space->user); $needIllnessCnt = TelOrderClient::getInstance()->queryNeedIllnessTelOrderCnt('TelOrder', $telOwner->id); if(!PaymentDataBucket::isOpenPhone($space)) { $needIllnessCnt = 0; } $infos['needIllnessCnt'] = $needIllnessCnt; $waitTimeCnt = TelOrderClient::getInstance()->queryWaitTimeTelOrderCnt('TelOrder', $telOwner->id); $waitTelOrderCount = TelOrderClient::getInstance()->getLastNotExeTelOrderCnt($telOwner->id); $isShowFreeButton = MainDataBucket::isShowPhoneButton($space, $waitTimeCnt, $waitTelOrderCount); $infos['isShowFreeButton'] = $isShowFreeButton; $infos['isFollowupOpened'] = ($space->isConfirmed() && false == $space->isOpenFollowup()) ? 0 : 1; //患者报道和医生补贴 $infos['isOpenSubsidy'] = $space->isSignSubsidyOpen()?'1':'0'; $patientSignForToday = DAL::get()->querySubsidyCntByTimeSpan('SubsidyOrder', $space->id, XDateTime::now()->toShortString()); $patientSignForMonth = DAL::get()->querySubsidyCntByTimeSpan('SubsidyOrder', $space->id, XDateTime::now()->addDay(-29)->toShortString()); $subsidyAccountAmount = AccountClient::getInstance()->getSubsidyOrdersAmountInTimespan($space->id, XDateTime::now()->addDay(-29)->toShortString(), XDateTime::now()); $infos['patientSignForToday'] = $patientSignForToday; $infos['patientSignForMonth'] = $patientSignForMonth; $infos['subsidyAccountAmount'] = $subsidyAccountAmount; } $belongDoctors = DoctorClient::getInstance()->getDoctorList4spaceByNoCache($userId); if(empty($belongDoctors)) { if ($doctorOwner->isPreDoctor()) { $infos['hospital'][0]['hospitalName'] = $doctorOwner->source->hospitalName; $infos['hospital'][0]['hospitalFacultyName'] = $doctorOwner->source->facultyName; } else { $this->setErrorCode(840); return 0; } } else { $i = 0; foreach($belongDoctors as $doctor){ $infos['hospital'][$i]['hospitalName'] = $doctor->hospitalfaculty->hospital->name; $infos['hospital'][$i]['hospitalFacultyName'] = $doctor->hospitalfaculty->name; $i++; } } $this->content = $infos; }/*}}}*/
<?php //define('_MEXEC','OK'); //require_once("../../../system/load.php"); //include('../../../config/config.php'); $dateTime = new DateTime("now", new DateTimeZone('Asia/Colombo')); $submitted_date = $dateTime->format("Y-m-d H:i:s"); $currentDate = date("F j, Y, g:i a"); $mainCity = new MainCity(); $SubCity = new SubCity(); $hotels = new Hotels(); $session = new Sessions(); //$mail = new SystemMail(); $reservations = new Reservations(); $bookingclient = new BookingClient(); $rooms = new HotelRoomType(); $hotels->setHotelId($_SESSION['hotels_id']); $hotels->extractor($hotels->getHotelFromId()); $merchantReferenceNo = $session->getMerchantReferenceNo(); $reservations->setReservationId($merchantReferenceNo); $pay_data = $reservations->getReservationsFromId(); $reservations->extractor($pay_data); $reservation_link_id = $reservations->reservationFromBookingLink(); $reservations_status = $reservations->reservationPaymentStatus(); $date = date("Y-m-d"); // current date $new_date = strtotime(date("Y-m-d", strtotime($date)) . " +3 month"); $expire_date = date("Y-m-d", $new_date); $bookingclient->setId($reservations->reservationClientId()); $bookingclient->extractor($bookingclient->getClientsFromId()); $rooms->setRoomTypeId($reservations->reservationHotelRoomTypeId());