public function newMaxNumberPost($request, $response) { /*{{{*/ $spaceId = $request->spaceId; $space = DAL::get()->find('space', $spaceId); $number = intval($request->max_number); $number = intval($request->max_number); if ($number == self::THREAD_NUB_OTHER) { $number = $request->getRequest('other', ''); if ($number == '') { throw new BizException('没有设置具体数量'); } } $fields = array('allowNewMaxNumber' => $number); if ($number != 0) { $fields['caseopened'] = Space::CASE_OPENED_YES; if (false == $space->isNewCaseOpen()) { $fields['caseapplyopened'] = 2; } } if ($space->modulecase->isNull()) { SpaceModuleCaseClient::getInstance()->initModuleCase($space); } $moduleCase = DAL::get()->find('SpaceModuleCase', $space->id); SpaceModuleCaseClient::getInstance()->modifyInfo($moduleCase->id, $fields); echo '成功修改'; return parent::DIRECT_OUTPUT; }
public function __construct($request, $response) { /*{{{*/ parent::__construct($request, $response); $response->imgTimestamp = BeanFinder::get('configs')->imgTimestamp; $spaceUserName = WebUtil::getSpaceUserName($request); $this->space = SpaceClient::getInstance()->getSpaceByUserName($spaceUserName); if ($this->space->isNull()) { header('Location: http://www.haodf.com'); exit; } if ($this->space->isHospitalFaculty()) { $requestUri = $_SERVER['REQUEST_URI']; header('Location: http://' . URL_PREFIX . $this->space->user->name . '.haodf.com' . $requestUri); exit; } $this->user = NullEntity::create(); $userId = UserClient::getInstance()->getCheckedSeed('id'); if ($userId) { $this->user = DAL::get()->find('user', $userId); } $response->space = $this->space; $response->user = $this->user; //未登录 或者 站外链接访问 skips if ($this->user->isNull() || false == $request->isQueryFromHDF()) { $this->skips($response); } $this->initModules($request, $response); $this->spaceIsLogin = $this->isSpaceLogin(); $response->spaceIsLogin = $this->spaceIsLogin; $response->isSpaceUser = $this->isSpaceUser(); $response->unreadCaseCount = $this->getUnReadCaseCount(); if ($this->space->modulecase->isNull()) { SpaceModuleCaseClient::getInstance()->initModuleCase($this->space); } $this->accessLog(); $configs = BeanFinder::get('configs'); $response->imgUrl = $configs->imgUrl; $response->spaceStyleId = $request->view_style_id ? $request->view_style_id : $this->space->getSpaceStyleId(); $response->_window_id = $request->window_id; $response->spaceBaseUrl = URL_PREFIX . $this->space->userName . '.haodf.com'; $response->title = $this->space->name . '大夫个人网站'; $response->scripts = array(); $response->spaceHits = $this->getSpaceHits($request); $response->goodDoctorList = $this->getGoodDoctorListOf2013(); $response->patientGoodDoctorList = $this->getPatientGoodDoctorListOf2013(); }
<td width="18%" align="center" valign="middle" nowrap="nowrap">医院</td> <td width="" align="center" valign="middle">擅长</td> <td width="10%" align="center" valign="middle">得票</td> <td width="18%" align="center" valign="middle">联系大夫</td> </tr> <?php $spaceIds = $isaskedfull = array(); foreach((array)$diseaseDoctorList as $diseaseDoctor) { if($diseaseDoctor->doctor->hasSpace() == false) continue; $spaceIds[] = $diseaseDoctor->doctor->space->id; } if(false == empty($spaceIds)) { $isaskedfull = SpaceModuleCaseClient::getInstance()->isAskedFullBySpaceIds($spaceIds); } $spaceList = DAL::get()->find('space', $spaceIds); $i = 0; foreach((array)$diseaseDoctorList as $diseaseDoctor) { $space = ($diseaseDoctor->doctor->hasSpace()) ? $spaceList[$diseaseDoctor->doctor->space->id] : new NullEntity(); $i++; if ($i == 11) break; ?> <tr class="yy_jb_df2"> <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="yy_jb_df3"> <tr> <td align="center"><img src="http://i1.hdfimg.com/images/hospital/icon_doctor.gif" align="absmiddle" width="12px" height="14px"/></td> <td><a href="<?=$diseaseDoctor->doctor->getUrl()?>" target="_blank" class="blue"><?=$diseaseDoctor->doctor->name?></a> <?php if (!$space->isNull()) { ?><a href="<?=$space->getUrl()?>"><img align="absmiddle" height="16" src="http://i1.hdfimg.com/images/common/iconhome16.gif" width="16" /></a><?php } ?>
public function getCaseStatus4PatientFixed($userId, $caseId, $caseType) {/*{{{*/ $thread = $this->getTheRightThread($caseId); $isOwner = 0; $caseInfo = array(); if($userId == $thread->userid) { $isOwner = 1; } if($thread->isNull()) { $this->setErrorCode(142); return 0; } if($this->getObjIsPrivate($thread) && $userId != $thread->patient->user->id && $userId != $thread->space->user->id) { $this->setErrorCode(155); return 0; } if($thread instanceof Intention || $thread instanceof Proposal) { if($thread instanceof Proposal && $thread->isClosed()) { $this->setErrorCode(704); return 0; } $caseInfo = self::_getCaseInfo4Fixed($thread, $userId, $isOwner); $caseInfo['canUserReply'] = ($thread instanceof Proposal && $thread->isNormalStatus()) ? 1 : 0; } else if($thread instanceof DoctorPatientRef) { if($thread->isDeleted() || $thread->isClosed()) { $this->setErrorCode(142); return 0; } $caseInfo = $this->getCaseInfo4Flow($thread, $userId, $isOwner); } $caseInfo['spaceCloseCase'] = 0; if (!$thread->space->isNull() && !$thread->space->isCaseOpen()) { $caseInfo['canUserReply'] = 0; $caseInfo['spaceCloseCase'] = 1; $caseInfo['msgInfo']['btns'] = array(); $caseInfo['msgInfo']['msg'] = $thread->space->name.'大夫的咨询功能暂时关闭'; } $doctorAllowAskBtn = ""; if($thread->space->isNull() == false && $thread->space->isAsk() && $userId != $thread->user->id) { $spaceCaseFull = SpaceModuleCaseClient::getInstance()->isAskedFull($thread->space); $doctorAllowAskBtn = ($spaceCaseFull) ? "我要咨询(咨询已满)" : "我要咨询"; } $caseInfo['doctorAllowAskBtn'] = $doctorAllowAskBtn; $caseInfo['isOwner'] = $isOwner; $this->content = $caseInfo; }/*}}}*/
private function getTip() { /*{{{*/ $tip = ''; if (false == $this->space->isCaseOpen()) { $tip = XString::convertToUnicode('您关闭了此功能,患者不能向您提问。<a href="javascript:;" onclick="case_link_bind()" class="edit3 f12">点击打开</a>'); } else { if (false == $this->space->isNewCaseOpen()) { $tip = XString::convertToUnicode('您限制了新患者提问,患者不能向您提问。<a href="/thread/ajaxcaseswitcher" class="popupwindow edit3 f12">点击设置</a>'); } else { if ($this->space->modulecase->allowNewMaxNumber == 0) { $tip = XString::convertToUnicode('您限制了新患者提问,患者不能向您提问。<a href="/adminthread/ajaxnewmaxnumber" class="popupwindow edit3 f12">点击设置</a>'); } else { if (SpaceModuleCaseClient::getInstance()->isAskedFull($this->space, $needCache = false)) { $tip = XString::convertToUnicode('您限制了患者提问数量,目前咨询已满,其他患者不能向您提问。<a href="/adminthread/ajaxnewmaxnumber" class="popupwindow edit3 f12">点击设置</a>'); } } } } return $tip; }
public function __construct($request, $response) {/*{{{*/ parent::__construct($request, $response); $this->clearWrongCookie(); $this->_spaceUserName = WebUtil::getSpaceUserName($request); if ($this->_spaceUserName == 'probe') { //构造函数里边,必须得exit才能跳转 $response->exitJump('http://www.haodf.com', 301); } $userId = UserClient::getInstance()->getCheckedSeed('id'); if ($userId) { $this->_newUser = DAL::get()->find('user',$userId); $this->_newUserId = $this->_newUser == null?null:$this->_newUser->id; } else $this->_newUser = new NullEntity(); $this->fix4thief($response); if ($this->_spaceUserName) $this->_newSpace = SpaceClient::getInstance()->getSpaceByUserName($this->_spaceUserName); else $this->_newSpace = new NullEntity(); if ($this->_newSpace->host instanceof Doctor) { $this->_newSpace->host->doctorIsDead(); } if ($this->_newSpace->isNull() || $this->_newSpace->host->isNull()) { //构造函数里边,必须得exit才能跳转 $response->exitJump('http://www.haodf.com', 301); } if($this->_newUser->id == $this->_newSpace->id) { $this->adminIsLogin = true; } $this->skips($response); //如果是admin登录,则会模拟成空间所属的医生登录 //注意:在判断是否是真正的医生登录时,要取cookie或session中的值 //问题:现在的管理员仅指admin一个用户,而不是具有管理员角色的人 if ($this->_newUser->isAdmin()) { $this->_newUser = $this->_newSpace->user; $response->adminIsLogin = $this->_adminIsLogin = true; } $this->_spaceIsLogin = (($this->_newUser->isNull() == false) && (strtolower($this->_spaceUserName) == strtolower($this->_newUser->name))) ? true : false; $this->_spaceBaseUrl = URL_PREFIX.$this->_spaceUserName.'.haodf.com'; $response->spaceBaseUrl = $this->_spaceBaseUrl; $this->_spaceStyleId = $request->view_style_id ? $request->view_style_id : $this->_newSpace->styleId; $response->spaceStyleId = $this->_spaceStyleId; $this->initAllMenu(); $mainMenu = $this->initMainMenu($request); $response->spaceMainMenu = $mainMenu; if ($this->_newSpace->modulecase->isNull()) SpaceModuleCaseClient::getInstance()->initModuleCase($this->_newSpace); $response->spaceIsLogin = $this->_spaceIsLogin; $response->newSpace = $this->_newSpace; $response->newUser = $this->_newUser; $response->forceCheckLogin = (isset($_SERVER['HTTP_HOST'])) ? "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] : ""; $response->_is_ajax = $request->is_ajax; $response->_window_id = $request->window_id; if ($this->_newSpace->isDoctor()) { $response->title = $this->_newSpace->name.'大夫个人网站'; } else { $response->title = $this->_newSpace->name.'网站'; $response->_my_template_dir = 'templates/hospitalfaculty'; } $response->spaceUserModule = ''; $response->spaceModule = ''; if (false == isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strpos($_SERVER['HTTP_X_REQUESTED_WITH'], 'XMLHttpRequest') === false) { $response->spaceHits = $this->getSpaceHits(); } $this->_log(); $configs = BeanFinder::get('configs'); $response->imgUrl = $configs->imgUrl; }/*}}}*/
<?php $tipstr = ""; //咨询区开启,且有最大数量限制 if ($space->isNewCaseOpen() && $space->modulecase->allowNewMaxNumber > 0) { if (false == $space->isNewCaseOpen()) { $tipstr = '目前暂不接受新问题'; } else { if (SpaceModuleCaseClient::getInstance()->isAskedFull($space)) { if ($space->isphoneOpened()) { $tipstr = "大夫每次最多回复" . $space->modulecase->allowNewMaxNumber . "条网络咨询,目前网络咨询已满"; } else { $tipstr = '目前暂不接受新问题'; } } } } elseif (false == $space->isCaseOpen()) { $tipstr = $space->host->name . '医生暂时不接受网络咨询'; } elseif ($space->isRefusedNewCase()) { $tipstr = '目前暂不接受新问题'; } elseif ($space->modulecase->allowNewMaxNumber != -1) { $tipstr = '目前暂不接受新问题'; } ?> <div class="mb30 mr_line1"> <p class="mr_title f18">网上咨询<?php echo $space->host->name; ?> 大夫</p> <div class="pl15 pr15 pb20 pt20 fs"> <?php
public function doctorList($request, $response) { $params = $page = array(); $facultyId = Codec::getInstance()->decodeId($request->faculty_id); $params['hospitalId'] = $this->_hospital->id; //$params['spaceAdminLevel'] = 3; $hfacultyList = $this->_hospital->getHospitalFacultyList(HospitalFaculty::IS_SELECT_FACULTY_BY_VOTE_YES); if(!$facultyId) { foreach ($hfacultyList as $faculties) { foreach($faculties as $hfaculty) { if($hfaculty->isNull() == false && $hfaculty->spaceCount) { $facultyId = $hfaculty->id;//默认取第一科室 break 2; } } } } $params['hospitalFacultyId'] = $facultyId; $page['nowPage'] = $request->getRequest('p', 1); $page['pageSize'] = 20; list($spaceList,$oPageInfo) = array_values(SpaceClient::getInstance()->getCaseOpenedSpaceList($params, $page)); $response->facultyId = $facultyId; $isaskedfull = $tmpSpaceList = array(); if(false == empty($spaceList)) { $isaskedfull = SpaceModuleCaseClient::getInstance()->isAskedFullBySpaceIds(array_keys($spaceList)); } $response->isaskedfull = $isaskedfull; $response->spaceList = $spaceList; //电话咨询接听数 $doctorids = array(); $doctorSatisfactionList = array(); foreach($spaceList as $space) { if($space->isPhoneOpened()) { $doctorids[] = $space->host->id; } } if( 0 < count($doctorids)) { $doctorSatisfactionList = PaymentClient::getInstance()->getDoctorSatisfactionList($doctorids); } $response->doctorSatisfactionList = $doctorSatisfactionList; //两周内回复数 $spacePostCntInfos = $this->getspacePostCntInfo($spaceList); $response->spacePostCntInfos = $spacePostCntInfos; $spaceAllPostCountInfos = array(); if (false == empty($spaceList)) { $spaceAllPostCounts = FlowClient::getInstance()->getSpaceReplyCountBySpaceIds(array_keys($spaceList)); foreach ($spaceAllPostCounts as $countInfo) { $spaceAllPostCountInfos[$countInfo['spaceid']] = $countInfo['cnt']; } } $response->spaceAllPostCountInfos = $spaceAllPostCountInfos; $response->hfacultyList = $hfacultyList; $faculty = DAL::get()->find('HospitalFaculty',$facultyId); $response->faculty = $faculty; //推荐专科 $response->spaceFacultyList = SpaceClient::getInstance()->getCaseOpenedFaculty4Hospital($this->_hospital->id, 50); $response->title = $this->_hospital->commonName.'专家咨询_好大夫在线'; $response->description = $this->_hospital->commonName."专家咨询,推荐".$this->_hospital->commonName .$this->_hospital->spaceCount."位专家在线咨询,全部由专家本人回复,".$this->_hospital->commonName."专家的经典问答。"; $response->keywords = $this->_hospital->commonName.'专家咨询,'.$this->_hospital->commonName.'专家在线咨询'; $response->pageModule = 'doctor'; $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate( $faculty->getOnlineDoctorUrl()."?p="), isset($oPageInfo['nowpage'])?$oPageInfo['nowpage']:'', isset($oPageInfo['pagesize'])?$oPageInfo['pagesize']:'', isset($oPageInfo['total'])?$oPageInfo['total']:''); }
public function updateThreadCategoryJudge($request, $response) { /*{{{*/ $categoryJudge = $request->category_judge; $spaceId = $request->space_user_id; SpaceModuleCaseClient::getInstance()->updateThreadCategoryJudge($spaceId, $this->curInspector->user->id, $categoryJudge); $response->setRedirect($response->router->urlfor('threadcate/recommendAuditDetail', array('space_user_id' => $spaceId, 'message' => '更新成功!'))); }
private function getDocotrAdvisoryStatus($request, $response) { /*{{{*/ $advisoryStatus = ""; //咨询区开启,且有最大数量限制 if ($this->space->modulecase->allowNewMaxNumber > 0 && $this->space->isNewCaseOpen()) { if (false == $this->space->isNewCaseOpen()) { $advisoryStatus = '目前暂不接受新问题'; } else { if (SpaceModuleCaseClient::getInstance()->isAskedFull($this->space)) { if ($this->space->isphoneOpened()) { $advisoryStatus = "大夫每次最多回复" . $this->space->modulecase->allowNewMaxNumber . "条网络咨询,目前网络咨询已满"; } else { $advisoryStatus = '目前暂不接受新问题'; } } } } else { if (false == $this->space->isCaseOpen()) { $advisoryStatus = $this->space->host->name . '医生暂时不接受网络咨询'; } else { if ($this->space->isRefusedNewCase()) { $advisoryStatus = '目前暂不接受新问题'; } else { if ($this->space->modulecase->allowNewMaxNumber != -1) { $advisoryStatus = '目前暂不接受新问题'; } } } } $response->advisoryStatus = $advisoryStatus; }
{ if( preg_match_all($url, $requestUri, $matches) > 0 ) { return true; } } return false; } //医生未开咨询或咨询已满,则不显示bubble if( isset($option['newSpace']) && $option['newSpace']->isDoctor() && true == findBubbleRequestURL($option['newSpace']->userName) && (false == $option['newSpace']->isNewCaseOpen() || true == SpaceModuleCaseClient::getInstance()->isAsked($option['newSpace']) ) ) { $showBubble = false; } else { $showBubble = true; } if($showBubble) { ?> $(function() {
public function getDoctorServiceInfoByDoctorId($doctorId) {/*{{{*/ $doctor = DAL::get()->find('doctor', $doctorId); if($doctor->isNull()) { $this->setErrorCode(132); return 0; } $content = array(); $caseInfo = array(); $bookingInfo = array(); $phoneInfo = array(); $shareInfo = array(); if($doctor->hasSpace()) { $space = $doctor->space; //case if($space->isAsk()) { $caseIntro = "医生对以下疾病可提供指导:"; $caseIntro .= $doctor->space->commonCaseNote == '' ? $doctor->specialize : $doctor->space->commonCaseNote; $spaceCaseIsFull = SpaceModuleCaseClient::getInstance()->isAskedFull($space); $caseInfo['caseIntro'] = $caseIntro; $caseInfo['caseTip'] = $spaceCaseIsFull ? "我要咨询(咨询已满)" : "我要咨询"; $caseInfo['caseTitle'] = "网络咨询"; $caseInfo['isShowHolidayNotice'] = 0; $mobileSetting = DAL::get()->find_by_keyname('MobileSetting', MobileSetting::KEY_NAME_HOLIDAY_NOTICE_CASE); if ($mobileSetting->hasHolidayNotice()) { $caseInfo['isShowHolidayNotice'] = 1; } } //booking if($space->isBookingOpened()) { $bookingInfo['bookingIntro'] = ""; $bookingInfo['bookingTip'] = "我要预约"; $bookingInfo['bookingTitle'] = "预约转诊"; $spaceBusinessRequirement = $space->getSpaceBusinessRequirement4Booking(); $requirementDisease = ''; if(false == $spaceBusinessRequirement->isNull()) { $requirementDisease = $spaceBusinessRequirement->disease; } $bookingInfo['bookingIntro'] = "疾病要求:".$requirementDisease; $bookingInfo['isShowHolidayNotice'] = 0; $mobileSetting = DAL::get()->find_by_keyname('MobileSetting', MobileSetting::KEY_NAME_HOLIDAY_NOTICE_BOOKING); if ($mobileSetting->hasHolidayNotice()) { $bookingInfo['isShowHolidayNotice'] = 1; } } //phone if($doctor->space->isPhoneOpenedForFront()) { $satisfactionLists = PaymentClient::getInstance()->getDoctorSatisfactionList($doctor->primaryId); $serviceCharge = PaymentClient::getInstance()->getServiceChargeList4WapBySpaceId($space->id); $serviceChargeList = explode('、', $serviceCharge); $str = ""; if (false == empty($serviceChargeList)) { $str .= "收费标准:\n"; foreach($serviceChargeList as $key => $serviceCharge) { $str .= $serviceCharge."\n"; } } if (isset($satisfactionLists[$space->host->id])) { $doctorSatisfaction = $satisfactionLists[$space->host->id]; $satisfaction = $doctorSatisfaction['scorecnt'] != 0?(round($doctorSatisfaction['goodscore']/$doctorSatisfaction['scorecnt'],2))*100:0; if($doctorSatisfaction['cnt'] != '' && $doctorSatisfaction['cnt'] != 0) { //$str .= "已成功接听".$doctorSatisfaction['cnt']."例,满意度".$satisfaction."%"; } } $phoneInfo['phoneIntro'] = XString::getContentWithOutHtml($str); $phoneInfo['phoneTip'] = "我要预约"; $phoneInfo['phoneTitle'] = "电话咨询"; $phoneInfo['isShowHolidayNotice'] = 0; $mobileSetting = DAL::get()->find_by_keyname('MobileSetting', MobileSetting::KEY_NAME_HOLIDAY_NOTICE_TELCASE); if ($mobileSetting->hasHolidayNotice()) { $phoneInfo['isShowHolidayNotice'] = 1; } } } $shareInfo = array(); $specialize = (mb_strlen($doctor->specialize, 'GBK') > 10) ? mb_substr($doctor->specialize, 0, 10, 'GBK').'...' : $doctor->specialize; $specializeStr = ($specialize) ? "擅长:".$specialize : ""; $grade = (in_array($doctor->grade, array('主任医师', '副主任医师'))) ? $doctor->grade : '医生'; $shareInfo['content'] = $doctor->hospitalfaculty->hospital->commonName.$doctor->hospitalfaculty->name."的".$doctor->name.$doctor->grade."很不错,".$specializeStr." 推荐看看".$doctor->getTouchShortUrl(); $this->content = array('case' => $caseInfo, 'booking' => $bookingInfo, 'phone' => $phoneInfo, 'share' => $shareInfo); }/*}}}*/
public function doctor($request, $response) { $this->initialize($request, $response); $title = $this->hospitalFaculty->hospital->commonName . $this->hospitalFaculty->name . '专家咨询_好大夫在线'; $descString = $this->hospitalFaculty->hospital->commonName . $this->hospitalFaculty->name ."专家咨询,推荐". $this->hospitalFaculty->hospital->commonName . $this->hospitalFaculty->name ."专家在线咨询"; $keywords = $this->hospitalFaculty->hospital->commonName . $this->hospitalFaculty->name ."专家咨询,". $this->hospitalFaculty->hospital->commonName . $this->hospitalFaculty->name ."专家在线咨询"; // $spaceList = SpaceClient::getInstance()->getListByHospitalFacultyId($this->hospitalFaculty->id, 'Doctor'); $params = array(); $page = array(); $params['hospitalFacultyId'] = $this->hospitalFaculty->id; $spaceList = SpaceClient::getInstance()->getCaseOpenedSpaceList($params); $spaceList = $spaceList['spaceList']; //两周内回复数 $spacePostCntInfos = $this->getspacePostCntInfo($spaceList); $response->spacePostCntInfos = $spacePostCntInfos; $spaceAllPostCountInfos = array(); if (false == empty($spaceList)) { $spaceAllPostCounts = FlowClient::getInstance()->getSpaceReplyCountBySpaceIds(array_keys($spaceList)); foreach ($spaceAllPostCounts as $countInfo) { $spaceAllPostCountInfos[$countInfo['spaceid']] = $countInfo['cnt']; } } $response->spaceAllPostCountInfos = $spaceAllPostCountInfos; //同地区同科室推荐医院 $hospitalFacultyList = DoctorClient::getInstance()->getHospitalFacultyListByAreaFaculty($this->hospitalFaculty, 6); $response->provinceList = Area::provInfo(); $response->commendHospitalFacultyList = $hospitalFacultyList['list']; $response->commendHospitalFacultyCnt = $hospitalFacultyList['cnt']; $this->getSidePhoneServiceListByHF($this->hospitalFaculty, $response, 10); $isaskedfull = array(); if (false == empty($spaceList)) { $isaskedfull = SpaceModuleCaseClient::getInstance()->isAskedFullBySpaceIds(array_keys($spaceList)); } $response->isaskedfull = $isaskedfull; $response->title = $title; $response->keywords = $keywords; $response->pageModule = 'doctor'; $response->currentSite = '咨询本科室大夫'; $response->descString = $descString; $response->spaceList = $spaceList; }
public function ajaxNewMaxNumberPost($request, $response) { $number = intval($request->max_number); $fields = array('allowNewMaxNumber'=>$number); if ($number != 0) { $fields['caseopened'] = Space::CASE_OPENED_YES; if (false == $this->_newSpace->isNewCaseOpen()) { $fields['caseapplyopened'] = Space::CASE_APPLY_OPENED_ALL; } } if($this->_newSpace->modulecase->isNull()){ SpaceModuleCaseClient::getInstance()->initModuleCase($this->_newSpace); } $moduleCase = DAL::get()->find('SpaceModuleCase', $this->_newSpace->id); SpaceModuleCaseClient::getInstance()->modifyInfo($moduleCase->id, $fields); if ($number > 0) { $message = XString::convertToUnicode('时间、精力有限,每次仅回复 '.$number.' 个新问题'); } else if ($number == -1) { $message = XString::convertToUnicode('不限制新问题数'); } else { $message = XString::convertToUnicode('不接受新问题'); } $result = array('number' => intval($request->max_number),'status' => 0,'message' => $message); echo json_encode($result); exit; }
/** * @brief 根据spaceid 设置网站咨询数目 * @author zhb * @exampleUrl http://dev.mobile-api.haodf.com/doctorapi/flowref_setaskintentionnum?userId=309570&number=5&xdoc=1 * * @Param $userId 医生userId * @Param $num 新患者数量( -1 不限制, > 0 具体个数, < 0 不接受新问题) * @Param $condition 咨询范围 * */ public function setAskIntentionNum($userId, $number) {/*{{{*/ $space = DAL::get()->find('space', $userId); if($space->isNull()) { $this->setErrorCode(328); return 0; } if ($number == '暂时不允许用户提问') { $number = 0; } else if ($number == '不限制') { $number = -1; } $fields = array('allowNewMaxNumber'=>$number); if ($number != 0) { $fields['caseopened'] = Space::CASE_OPENED_YES; if (false == $space->isNewCaseOpen()) { $fields['caseapplyopened'] = Space::CASE_APPLY_OPENED_ALL; } } $moduleCase = DAL::get()->find('SpaceModuleCase', $space->id); SpaceModuleCaseClient::getInstance()->modifyInfo($moduleCase->id, $fields); }/*}}}*/