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 stopAddSignPost($request, $response) { ini_set('display_errors', false); // json output do no error information $vars = $request->var; $vars = XString::toGbkDeep($vars); $beginTime = $vars["year1"].'-'.$vars['month1'].'-'.$vars['day1'].' '.$vars['time1'].':00:00'; $endTime = $vars["year2"].'-'.$vars['month2'].'-'.$vars['day2'].' '.$vars['time2'].':00:00'; $beginTime = $beginTime; $endTime = $endTime; $doctorUserId = $this->_newSpace->id; if ($beginTime > $endTime){ echo json_encode(array( 'status' => 1, 'content' => XString::convertToUnicode('开始时间大于结束时间'), )); exit; } else { $orderList = BookingClient::getInstance()->getSendSmsOrderList($this->_newSpace->id, $beginTime, $endTime); if (empty($orderList)){ echo json_encode(array( 'status' => 1, 'content' => XString::convertToUnicode('选择时间内没有加号信息'), )); exit; } else { foreach ($orderList as $order) { try { $user = DAL::get()->find('User', $this->_newSpace->id); BookingClient::getInstance()->doctorCancelOrder($user, $order->id); } catch(Exception $e) { $msg = '发送失败,原因是可能你已经发送过了'; } } $msg = '停诊通知已告知相应患者'; echo json_encode(array( 'status' => 0, 'content' => XString::convertToUnicode($msg), )); exit; } } }
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'; //返回页面类型,暂时用于控制二级导航 }/*}}}*/
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 _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); }
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; }
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 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); }
private function getDoctorCount($request, $response) {/*{{{*/ //开通加号 $response->openBookingCount = BookingClient::getInstance()->getOpenBookingDoctorCount($this->hospitalFaculty->hospital->id, $this->hospitalFaculty->faculty->name); //所有 $response->allCount = $this->hospitalFaculty->doctorCount; }/*}}}*/
private function _getBookingCounts($spaceIds) {/*{{{*/ $bookingCnts = BookingClient::getInstance()->getFinishBookingCntBySpaces($spaceIds); return $bookingCnts; }/*}}}*/
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); } }/*}}}*/
private function getDoctorList($request, $response) {/*{{{*/ $nowPage = $request->getRequest('p', 1); $pageSize = self::SCHEDULE_PAGE_SIZE; $orderby = $this->orderby; List($pageLink, $doctorList) = $this->getDocListByOrder($orderby, $nowPage, $pageSize); $scheduleTables = Schedule::buildTable($doctorList); $doctorIds = array(); $spaceIds = array(); foreach($doctorList as $doctor) { //取的主id因为投票全要取主科室的 $doctorIds[] = $doctor->primaryId; if($doctor->hasSpace()){ $spaceIds[] = $doctor->space->id; } } $doctorDiseaseList = array(); if(empty($doctorIds) == false) $doctorDiseaseList = DiseaseClient::getInstance()->getDiseaseDoctorList($doctorIds, 200); $tmpResults = array(); if(empty($spaceIds) == false){ $tmpResults = SpaceClient::getInstance()->getTmpSpacePostCnt($spaceIds); } $spacePostCntInfos = array(); foreach($tmpResults as $tmpResult){ $spacePostCntInfos[$tmpResult['userid']] = $tmpResult['postcount']; } $bookingList = array(); //取开通加号医生 if ($spaceIds){ $bookingList = BookingClient::getInstance()->getContractIds($spaceIds); } $response->bookingList = $bookingList; $response->scheduleTables = $scheduleTables; $response->spacePostCntInfos = $spacePostCntInfos; $response->schedulepageLink = $pageLink; $response->doctorDiseaseList = $this->formatDoctorDisease($doctorDiseaseList); $response->doctorList = $doctorList; }/*}}}*/
private function isJiahaoRedTip($space) {/*{{{*/ $isJiahaoOpened = $space->isBookingOpened(); if(false == $isJiahaoOpened) { return array(0,0); } $requirement = $space->getSpaceBusinessRequirement4Booking(); $isProxy = $requirement->isProxy() ? SpaceBusinessRequirement::PROXY_YES : SpaceBusinessRequirement::PROXY_NO; $ids = DAL::get()->queryAdminConfirmOrder('BookingTask', $space->host->id); $isHave = empty($ids) ? 0 : 1; $params['wap'] = true; $orderCount = BookingClient::getInstance()->getOrderListCount4Doctor($space->id, $params); $cnt = $jiahaoCount = 0; foreach($orderCount as $name=>$count) { if( ( $name == BookingOrderDataBucket::STATUS_PENDING && !$isHave && $isProxy == SpaceBusinessRequirement::PROXY_NO || $name == BookingOrderDataBucket::STATUS_TODAY ) ) { $cnt += $count; } if($name == BookingOrderDataBucket::STATUS_PENDING && false == empty($ids)) { $jiahaoCount = 0; } else if($name == BookingOrderDataBucket::STATUS_PENDING) { $jiahaoCount = $count; } } if($cnt > 0) { return array(1,$jiahaoCount); } return array(0,$jiahaoCount); }/*}}}*/
} $price = array(); foreach($productList as $product) { $price[] = $product->salePrice."/".$product->duration; } $price = implode('; ', $price); $orderDetailCnt = TelOrderClient::getInstance()->getOrderDetailCnt('telorder', $order); //取电话的订单数目 $patientExt = $order->patient->getPatientExt(); $phone1 = isset($patientExt->phone1)?$patientExt->phone1:''; $phone2 = isset($patientExt->phone2)?$patientExt->phone2:''; $cntOfOrdersByPhone1 = TelOrderClient::getInstance()->getCntOfOrdersByPhone($phone1); $cntOfOrdersByPhone2 = TelOrderClient::getInstance()->getCntOfOrdersByPhone($phone2); $caseList = DAL::get()->find_all_by_userid('Thread', $order->user->id); $bookingOrderList = BookingClient::getInstance()->getUserBookingList($order->user->id); ?> <!-- start orderDetails--> <div class="orderDetails-t"> <div class="" style="background: none repeat scroll 0 0 #FFF8ED;"> <span class="red">订单号:</span> <span><a href="<?=$router->urlfor('telorder/orderdetail', array('orderId'=>$order->id))?>" target="_blank"><?=$order->id?></a></span> <span class="m5">下单时间:<?=$order->ctime->toString()?></span> <span class="ml5"> <?php if($order->getMinute()) {?> <?= $order->getMinute().'分钟 / '.$order->getPrice().'元' ?> <?php }?> <span class="ml5 fb"><?=$order->getStatusDesc() ?></span> </span> </div> <div class="clearfix">
public function showOneDetail($request, $response) { /*{{{*/ $doctorComment = null; $ticket = new NullEntity(); $doctorComment = DoctorCommentClient::getInstance()->getDoctorCommentSubClass($request->id); if ($request->msg == 'delete') { echo '此点评已经删除'; exit; } if ($doctorComment->isNull()) { echo '没有相关的点评数据'; exit; } $diseaseDoctorList = array(); if (!$doctorComment->doctor->isNull()) { $diseaseDoctorList = DiseaseDoctorClient::getInstance()->getDoctorExpertDisease($doctorComment->doctor->id, 10); } $jiaHaoStatus = ''; $userPhoneThreadList = ''; $doctor = DAL::get()->find('doctor', $doctorComment->doctor->id); if ($doctor->hasSpace()) { $spaceId = $doctor->space->id; if ($doctorComment->patientId) { $jiaHaoStatus = BookingClient::getInstance()->getPatientBookingStatus($doctorComment->patientId, $spaceId); $userPhoneThreadList = PaymentClient::getInstance()->getPatientSuccessServiceList($doctorComment->patientId, $spaceId); } } $session = SessionDefault::singleton(); $privilege = PrivilegeClient::getInstance()->getByUserName($session->UserName); $srcException = DAL::get()->queryException4Comment('doctorcomment', $doctorComment); $response->srcException = $srcException; $response->doctorComment = $doctorComment; $response->diseaseDoctorList = $diseaseDoctorList; $response->jiaHaoStatus = $jiaHaoStatus; $response->userPhoneThreadList = $userPhoneThreadList; $response->privilege = $privilege; $response->msg = $request->msg; $response->textInspectResult = DAL::get()->find_by_sourceid_and_sourcetype('DoctorCommentInspectResult', $doctorComment->id, get_class($doctorComment)); $readonlyContent = $doctorComment->getOriginalContent(); $sensContentArr = BeanFinder::get('ContentFilter')->getSensitiveWordsRecursive('comment', $readonlyContent); foreach ($sensContentArr as $sensContent) { $readonlyContent = str_replace($sensContent, "<span class='red'>{$sensContent}</span>", $readonlyContent); } $response->readonlyContent = $readonlyContent; $response->ticket = $ticket; }
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; }/*}}}*/
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; }/*}}}*/
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; }/*}}}*/
public function newBookingDoctorList4msn($request,$response) { $response->bookingContractList = BookingClient::getInstance()->getNewBookingContractList(); }
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; }/*}}}*/
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 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; }/*}}}*/
<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 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; } }
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; }/*}}}*/
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); }/*}}}*/
/** * 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 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 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; }/*}}}*/
private function getCounts($ref, $response) {/*{{{*/ $presentOrders = DAL::get()->find_all_by_spaceid_and_patientid_and_status('presentorder', $ref->space->id, $ref->patient->id, PresentOrder::STATUS_PAID_YES); $response->presentOrderCnt = count($presentOrders); $response->spacePostCnt = $ref->spacePostCount; $telOrders = PaymentClient::getInstance()->getPatientSuccessServiceList($ref->patient->id, $ref->space->id); $response->telOrderCnt = count($telOrders); $bookingOrders = BookingClient::getInstance()->getList4Flow($ref->space->id, $ref->patient->id); $response->bookingOrderCnt = count($bookingOrders); $patientApply = PatientSigninClient::getInstance()->getList4Flow($ref->space->id, $ref->patient->id); $patientSignin = PatientSigninClient::getInstance()->getList4Flow($ref->space->id, $ref->patient->id); $response->oldPatientCnt = count($patientApply) + count($patientSignin); }/*}}}*/