public function patientApply($request, $response) {/*{{{*/ $this->forceSpaceModuleCheck('Case',$response); $threadId = $request->case_id; $thread = DAL::get()->find('thread', $threadId); if ($this->_refuseNotIsUserCase($response, $thread)) { return false; } //处理提交的就医需求 $postContent = "看此医生门诊的具体时间:\n\n".$request->req_time; $postContent .= "\n\n医生给您做的检查项目、结果及给出的处置方案:\n\n".$request->req_content2; $postContent .= "\n\n您还需要的帮助:\n\n".$request->req_content3; $postContent = preg_replace('/<!--.*?-->/ms', '', $postContent); $postContent = preg_replace('/<!--.*?-->/ms', '', $postContent); if (!$this->_spaceIsLogin) { $postContent = htmlspecialchars($postContent, ENT_COMPAT | ENT_HTML401, 'ISO-8859-1'); } $patientApply = array(); $patientApply['content'] = $postContent; $patientApply['attachmentIds'] = $request->getRequest('post_patient_attachment_ids', ''); $user = DAL::get()->find('user', $this->_newUser->id); PatientApplyClient::getInstance()->add($user, $thread->id, $patientApply); $response->setRedirect($thread->getUrl().'#last_post'); }/*}}}*/
public function requestReopenCase($userId, $caseId, $treatTime, $lastResult, $howHelp) {/*{{{*/ $thread = DAL::get()->find('thread', $caseId); if($thread->isNull()) { $this->setErrorCode(142); return 0; } $user = DAL::get()->find('user', $userId); if ($user->isNull()) { $this->setErrorCode(107); return 0; } if ($userId != $thread->patient->user->id) { $this->setErrorCode(154); return 0; } if ($this->_refuseNotIsUserCase($user, $thread)) { $this->setErrorCode($this->_refuseNotIsUserCase($user, $thread)); return 0; } //处理提交的就医需求 $postContent = "看此医生门诊的具体时间:\n\n".$treatTime; $postContent .= "\n\n医生给您做的检查项目、结果及给出的处置方案:\n\n".$lastResult; $postContent .= "\n\n您还需要的帮助:\n\n".$howHelp; $postContent = preg_replace('/<!--.*?-->/ms', '', $postContent); $postContent = preg_replace('/<!--.*?-->/ms', '', $postContent); if ($userId == $thread->space->user->id) { $this->setErrorCode(149); return 0; } else { $postContent = htmlspecialchars($postContent, ENT_COMPAT | ENT_HTML401, 'ISO-8859-1'); } $patientApply = array(); $patientApply['content'] = $postContent; $patientApply['attachmentIds'] = ''; PatientApplyClient::getInstance()->add($user, $thread->id, $patientApply); }/*}}}*/