public function ajaxSendMessageNfs($request, $response) { /*{{{*/ $msgInfos = $_POST['msginfo']; $msgInfos = XString::convertArrayToGbk($msgInfos); $phoneNums = $msgInfos['phonenum']; $patientNames = $msgInfos['patientname']; $doctorNames = $msgInfos['doctorname']; $contents = $msgInfos['content']; $data = array(); foreach ($phoneNums as $key => $value) { $phoneNum = $value; $patientName = $patientNames[$key]; $doctorName = $doctorNames[$key]; $content = $contents[$key]; $preg1 = '/{?\\$data\\[(\'|\\"){1}(patientname){1}(\'|\\"){1}\\]}?/'; $preg2 = '/{?\\$data\\[(\'|\\"){1}|(doctorname){1}(\'|\\"){1}\\]}?/'; $content = preg_replace($preg1, $patientName, $content); $content = preg_replace($preg2, $doctorName, $content); SMSClient::getInstance()->sendSMS(array($phoneNum), $content, SMSLog::OPT_TYPE_FULLOWUP, '', SMSMD::EXT_8); } //有时会先执行下面writeMessageSendLog中的sql,再执行上面sendSMS的sql,这样会有逻辑错误。暂时sleep一下处理 sleep(1); FollowupClient::getInstance()->writeMessageSendLog($phoneNums, $request->contenttype, $request->msgtemplateid, $this->auditor); echo "success"; return parent::DIRECT_OUTPUT; }
private function ajaxSetUpdateSession($request, $response) {/*{{{*/ if (!session_id()) { session_start(); } $intentionInfos = $request->intentionInfos; $params = array(); foreach ($intentionInfos as $key => $intentionInfo) { foreach ($intentionInfo as $type => $value) { DBC::requireFalse($type == 'diseaseInfos' && $value['diseaseName'] == "", "疾病信息不能为空"); $_SESSION['askUpdateMemory'][$request->intentionid][$type][$key] = XString::convertArrayToGbk($value); } } }/*}}}*/
private function createPatientCourse($patientCase, $request) { /*{{{*/ $courseType = XString::convertToGbk($request->courseType); $courseMark = XString::convertToGbk($request->courseMark); $courseDetails = XString::convertArrayToGbk($request->courseDetails); $courseSummary = md5($patientCase->doctorOwner->id . XString::convertToGbk($request->name) . time()); $patientCourseAsyncDto = PatientCourseAsyncDto::create($patientCase, $courseType, $courseSummary, $request->courseOccurDate, $courseMark, $courseDetails, 'INSPECTOR'); $patientCourseInfos = PatientCourseClient::getInstance()->createPatientCourseWithContent($patientCourseAsyncDto); $patientCourse = new NullEntity(); if (isset($patientCourseInfos['courseId']) && $patientCourseInfos['courseId']) { $patientCourse = DAL::get()->find('patientcourse', $patientCourseInfos['courseId']); PatientCourseClient::getInstance()->setPatientCoursePass($this->curInspector, $patientCourse); } return $patientCourse; }