/** * @brief 首页未读通知列表 * @author whd * @exampleUrl http://dev.mobile-api.haodf.com/patientapi/message_getmsglistforhome?userId=613876396&xdoc=1 * * @Param $userId 用户id * * @Returns array('id', 'title', 'isread', 'senderName', 'content', 'ctime') */ public function getmsglistforhome($userId) {/*{{{*/ $this->getInboxMsgListByUserId($userId, 'orderbyunread', 1, 3); $type = Box::TYPE_INBOX; $options = array('filterSourceType'=>Message::TYPE_PATIENTCLUB, 'isread'=>0); $unreadCnt = StationLetterClient::getInstance()->getMsgCountByOptions($userId, $type, $options); $this->pageInfo['total'] = $unreadCnt; }/*}}}*/
public function ajaxSetRead($request, $response) { $str = ''; if (UserClient::getInstance()->isLogin() && $request->msgid) { $data = array('UserId' => $this->user->id, 'MsgId' => $request->msgid); StationLetterClient::getInstance()->setMsgRead($data['UserId'], $data['MsgId']); $str = "²Ù×÷³É¹¦"; } $response->callBack = $request->callback; $response->msg = $str; }
private function doctorActionLog($request) { $app = $request->getRequest('app'); if('doctor' == $app) { $userId = $request->getRequest('userId'); $action = $request->action; $v = $request->getRequest('v'); $os = $request->getRequest('os'); if(trim($userId) != '' && $userId != 0) { StationLetterClient::getInstance()->createwapdoctoractionlog('wapdoctoractionlog', $userId, $action, $app, $os, $v); } } }
public function refuseHeadImg($request, $response) { /*{{{*/ $oldImg = $request->oldImg; $result = DoctorClient::getInstance()->modifyDoctorLogSetRefused($request->id); $user = DAL::get()->find('User', $request->userId); $tplname = "doctor.photo.refuse"; $datas = array(); $datas['doctorname'] = $user->space->name; //站内消息 $userid = $user->id; StationLetterClient::getInstance()->sendMsgByTpl($tplname, Auditor::ADMIN_USER_ID, array($userid), $datas); $response->result = $result; $response->actionDesc = "确认"; $response->id = $request->id; return 'auditProcess'; }
public function processInput($request) {/*{{{*/ $this->transferSecurityInfo($request);//如果有$data['_s']参数,要对其加密,然后与不加密的数据合并 $this->sortRequestArgs($request); $this->args = $this->formatInput($this->args); $version = BeanFinder::get('configs')->version; $requestVersion = $request->version; if ($requestVersion == 'fu1.0') { $version = $request->version; } //记录医生端医生操作日志 $app = $request->getRequest('app'); $v = $request->getRequest('v'); if(('doctor' == $app && $v >= '2.0.0') || 'doctorhd' == strtolower($app)) { // $spaceId = $request->getRequest('spaceId'); $s = $request->getRequest('_s'); $spaceId = $request->getRequest('spaceId'); if($s != '' && $spaceId == '') { $key = self::CRYPE_KEY; $decrypts = json_decode(DataCrypt::decryptWithKey($s, $key), true); $spaceId = isset($decrypts['spaceId']) ? $decrypts['spaceId'] : 0; } $action = $request->action; $os = $request->getRequest('os'); if(trim($spaceId) != '' && $spaceId != 0) { StationLetterClient::getInstance()->createwapdoctoractionlog('wapdoctoractionlog', $spaceId, $action, $app, $os, $v); } } return array('action'=>$request->action, 'os'=>$request->os, 'version'=>$version, 'signature'=>$request->signature, 'args'=>$this->args, 'databucket'=>$this->databucket); }/*}}}*/
public function letterCountDetail($request, $response) { /*{{{*/ $date = $request->getRequest('date', ''); $tel = $request->getRequest('tel', ''); $userName = $request->getRequest('userName', ''); $nowPage = $request->getRequest('p', 1); $pageSize = 50; $tel = XString::decodeMobileNo($tel); $userids = array(); if (empty($tel) == false && empty($userName) == false) { $userids = Dal::get()->find_id_by_name_and_mobile('user', $userName, $tel); if (empty($userids) == true) { return; } } else { if (empty($tel) == false && empty($userName) == true) { $userids = Dal::get()->find_id_by_mobile('user', $tel); if (empty($userids) == true) { return; } } else { if (empty($tel) == true && empty($userName) == false) { $userids = Dal::get()->find_id_by_name('user', $userName); if (empty($userids) == true) { return; } } } } $res = StationLetterClient::getInstance()->getStationLetterList($date, $userids, $nowPage, $pageSize); $messageids = array(); foreach ($res['ids'] as $value) { $messageids[] = $value['messageid']; } $userids = array(); foreach ($res['ids'] as $value) { $userids[] = $value['userid']; } $out['list'] = array(); if (empty($messageids) == false) { $out['list'] = DAL::get()->find('message', $messageids); } $out['userlist'] = array(); if (empty($messageids) == false) { $out['userlist'] = Dal::get()->find('user', $userids); } $response->ids = $res['ids']; $response->messageList = $out['list']; $response->userList = $out['userlist']; $response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("/message/lettercountdetail?date={$date}&tel={$tel}&userName={$userName}&p="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']); }
public function acceptedApply($request, $response) { /*{{{*/ $this->initialize($request, $response); $response->patientQuestionSheetRef = DAL::get()->find_by_patientid_and_status('PatientQuestionSheetRef', $this->patient->id, PatientQuestionSheetRef::STATUS_VALID); DBC::requireFalse($response->patientQuestionSheetRef->isNull(), "请为患者创建问卷"); PatientFileClient::getInstance()->setPatientHealthApplyValid($this->id); $apply = DAL::get()->find('PatientHealthApply', $this->apply->id); S3LogClient::getInstance()->add($this->auditor, $apply->getLogable()->action(PatientHealthApplyLog::TYPE_ACCEPT, '通过了申请')); if ($this->apply->createType == PatientHealthApply::TYPE_NEW) { //发送站内信 $msgContent = "恭喜您," . $this->patient->user->name . ",您为" . $this->patient->name . "提交的健康日记申请已通过审核,医生助理已经帮助您设置了健康记录管理项,现在开始记录今天的健康状况吧!"; $options = array('relationShip' => $this->apply, 'ispush' => 1); StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $this->patient->user->id, "健康日记提醒", $msgContent, $options); } $url = $response->router->urlfor('patientfile/applydetail', array('id' => $this->id)); $response->setRedirect($url); }
public function createPost($request, $response) {/*{{{*/ $ref = DAL::get()->find('DoctorPatientRef', $request->refid); if($ref->isNull()) { die('流关系不存在'); return; } if (false == FollowupAssistantClient::getInstance()->hasAssistRights($this->user->id, $ref->space->id)) { echo '没有权限发表'; exit; } $option = array(); $attachmentIds = ($request->attachmentIds != null) ? $request->attachmentIds : ''; $attachmentArr = explode(',', $attachmentIds); $option['attachmentIds'] = $attachmentArr; $content = $ref->space->name."大夫和您有新对话<a href='".$ref->url."' target='_blank'>点击查看详情</a>"; $title = $ref->space->name."大夫和您有新对话"; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $ref->user->id, $title, $content); $postContent = $request->getRequest('content'); if(($postContent == '点击此处跟大夫对话!' || $postContent == '') && $attachmentIds <> '') { $postContent = '有新资料上传'; } $post = DoctorPatientPostClient::getInstance()->addPost($request->refid, $ref->space->user->id, $postContent, $option); DBC::requireFalse($post->isNull(), '系统繁忙,请稍后重试'); //系统日志 try{ FlowClient::getInstance()->addLog($ref,$ref->space->user, DoctorPatientLog::TYPE_SYSTEM_LOG, 'SuiFangController::createPost', $post); }catch(Exception $ex) {} //记录助理日志 if ($this->user->id != $ref->space->id) { FollowupClient::getInstance()->addFollowupLog($this->user->id, $post->id); SpaceLogClient::getInstance()->addLog($ref->space->user->id, SpaceLog::SPACE_LOG_TYPE_REPLY_FLOW, $ref->id, $ref->title); } $response->setRedirect('/suifang/taskdetail?refId='.$ref->id); }/*}}}*/
public function delete($request, $response) {/*{{{*/ StationLetterClient::getInstance()->delMsg($this->user->id, array($request->id)); $response->setRedirect($response->router->urlfor('internalmessage/messagelist')); }/*}}}*/
private function realFinish($request, $response) { $user = UserClient::getInstance()->getCurrentUser(); $response->userName = ''; if ($user->hasSpace() == false) { MsgHtml::msg('医生注册失败, 请重新尝试, <a href="http://www.haodf.com/suggestion/suggestion">或与我们联系</a>'); } else { $response->space = $user->space; $response->userName = $user->name; try { $tplname = "doctor.reg.success"; $userId = $user->id; $datas = array(); $datas['doctorname'] = $user->realName; $datas['username'] = $user->name; //站内消息 StationLetterClient::getInstance()->sendMsgByTpl($tplname, Auditor::ADMIN_USER_ID, array($userId), $datas); //邮件 $email = $user->email; EmailClient::getInstance()->sendByTpl($tplname, $email, $datas, true); $operators = array(); $operators['zxh']="张旭海"; $operators['lyp']="刘义平"; $operators['dh']="代红"; $operators['ll']="刘柳"; $operators['liu']="刘柳"; $operators['ccm']="陈超美"; $operators['test']="内部测试"; $operators['sjp']="史建平"; $operators['ylf']="杨利锋"; $operators['cf']="崔芳"; //内部注册特殊处理 $userPhone = $user->phone; foreach($operators as $key=>$value) { if(strpos($userPhone,$key) !== false) { $userPhone = trim(str_replace($key,'',$userPhone)); $userPhone = str_replace('()',' ',$userPhone); $userPhone = str_replace('( )',' ',$userPhone); $dd = array(); $dd['phone'] = $userPhone; $dd['spaceRemarks1'] = $user->spaceRemarks1."电话拜访"; $dd['spaceRemarks2'] = $user->spaceRemarks2.$value; $userId = UserClient::getInstance()->modifyInfoNew($userId, $dd); $tplname = "doctor.reg.success.2"; break; } //防刷新时,发送电话拜访的短信 if(strpos($user->spaceRemarks2, $value) !== false) { $tplname = "doctor.reg.success.2"; break; } } //暂时只发自注册医生的短信通知 if($tplname != "doctor.reg.success.2") { //短信 $phone = $user->mobile; SMSClient::getInstance()->sendSMSByTplName($tplname, array($phone), $datas, SMSLog::OPT_TYPE_DOCTOR_REG_SUCCESS, '', true); } } catch(Exception $ex) { //暂时忽略异常 } } }
private function modifyScore($thread, $post, $user) {/*{{{*/ ScoreClient::getInstance()->reply($user, $thread); $result = ScoreClient::getInstance()->goodAsk($thread); if($result) { $subject = '奖励咨询点'; $score = Event::getPatientAmount('goodAsk'); $messageContent = '由于您详细填写病情资料,系统奖励:<span class="orange">+ '.$score.'咨询点</span><br><br>本奖励咨询点可用于向大夫提问问题<br>'; StationLetterClient::getInstance()->sendMsg(Auditor::ADMIN_USER_ID, array($thread->user->id), $subject, $messageContent); } }/*}}}*/
public function ajaxSentNotice($request, $response) {/*{{{*/ try { $hasSend = empty($_COOKIE['sdmsg']) ? false : true; if (false == $hasSend && $this->curUser instanceof User && false == $this->curUser->hasSpace()) { $title = '关于网站账户合并的意见征求'; $content = " 尊敬的用户 <br> 您好! <br> 非常感谢您使用好大夫网站提供的服务,由于在用户注册上一直没有要求手机号唯一,现在网站用户量持续增加,存在大量一手机(或邮箱)关联多账户的情况, 在网站提供服务的过程中用户不能直接使用手机号登录,造成很多不便,也给用户的帐户安全埋下隐患。为此,网站将计划在适当时候,针对一手机号对应多账户的情况进行合并, 即一个用户手机号(或邮箱)只能保留一个账户。 如果您存在多账户的情况,为了您的资料安全,可能需要您提前考虑把其他账户的资料(包含和医生的交流、积分、账户余额等)合并到一个账户里,到时网站将提供账户合并功能帮助您完成用户合并操作。 <span style='color:red;'>我们非常需要了解您的意见,请到“</span><a style='color:blue;' target=‘’_blank href='http://www.haodf.com/suggestion/suggestion'>意见建议</a><span style='color:red;'>”版块发表您的看法并提交给我们。</span> <p style='text-align:right;'>好大夫在线</p> <p style='text-align:right;'>".XDateTime::now()->toShortString()."</p> "; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $this->curUser->id, $title, $content, array()); } $cookie = new HdfCookie(); $cookie->set("sdmsg", "1", XDateTime::ONE_DAY_SECOND*30); } catch(Exception $ex) { } header('Content-type: application/x-javascript'); echo $request->callback.'('; echo json_encode(array()); echo ');'; return parent::DIRECT_OUTPUT; }/*}}}*/
public function getRecommendAppList($os) {/*{{{*/ $ids = StationLetterClient::getInstance()->getPromotionListByOS($os); $infos = array(); foreach($ids as $id) { $info = array(); $promotion = DAL::get()->find('wappromotion', $id); $info['id'] = $promotion->id; $info['name'] = $promotion->name; $info['url'] = "http://www.".URL_PREFIX."haodf.com/index/mobilepromotion?id=".$promotion->id; $info['intro'] = $promotion->intro; $info['logoUrl'] = $promotion->getLogoUrl(); $infos[] = $info; } $pageInfo = self::getPageInfo($infos); $this->pageInfo = $pageInfo; $this->content = $infos; }/*}}}*/
<td>IosHaodf</td> <td>IosDoctor</td> <td>其他</td> <td>Android</td> <td>AndroidHaodf</td> <td>AndroidDoctor</td> <td>AndroidFollowup</td> <td>其他</td> <td>总量</td> </tr> <?php if(empty($phoneLogList) == false) { foreach($phoneLogList as $phoneLog){ $logTime = $phoneLog->logTime->toShortString(); $extraCnt = StationLetterClient::getInstance()->getExtraCntForAndroid($logTime); ?> <tr> <td><?=$phoneLog->logTime->toShortString()?></td> <td><?=$phoneLog->iosCount?></td> <td><?=$phoneLog->iosHaodfCount?></td> <td><?=$phoneLog->iosDoctorCount?></td> <td><?=$phoneLog->iosCount-$phoneLog->iosDoctorCount-$phoneLog->iosHaodfCount?></td> <td><?=$phoneLog->androidCount-$extraCnt?></td> <td><?=$phoneLog->androidHaodfCount-$extraCnt?></td> <td><?=$phoneLog->androidDoctorCount?></td> <td><?=$phoneLog->androidFollowupCount?></td> <td><?=$phoneLog->androidCount-$phoneLog->androidDoctorCount-$phoneLog->androidHaodfCount-$phoneLog->androidFollowupCount?></td> <td><?=$phoneLog->total?></td> </tr> <?php
public function showDoctorWapActionList($request, $response) { $searchTime = trim($request->searchTime); $spaceId = trim($request->spaceId); if (false == empty($searchTime)) { $searchTime = date("Y-m-d", strtotime($searchTime)); } else { $searchTime = XDateTime::today()->toShortString(); } $searchTime = XDateTime::valueOf($searchTime); $searchTimeAssistant = $searchTime->addDay(1); $doctorActionIds = StationLetterClient::getInstance()->getDoctorActionLogIds('WapDoctorActionLog', $searchTime, $searchTimeAssistant, $spaceId); $doctorWapActionList = DAL::get()->find('WapDoctorActionLog', $doctorActionIds); $space = DAL::get()->find('space', $spaceId); $response->searchTime = $searchTime; $response->spaceId = $spaceId; $response->space = $space; $response->doctorWapActionList = $doctorWapActionList; }
public function passPredoctor($request, $response) { /*{{{*/ $ticket = DAL::get()->find('ticket', $request->ticketid); $predoctor = $ticket->source; DBC::requireFalse($predoctor->isNull(), '医生不存在'); $resultDto = new PreDoctorInspectResultDto(PreDoctor::STATUS_CONFIRMED, $ticket->source, ''); InspectClient::getInstance()->next($ticket->id, $resultDto, $this->curInspector); StationLetterClient::getInstance()->sendPush($predoctor->user->id, 0, 0, 'doctor', '', '医生您好,欢迎使用您的个人工作站,认证正在进行中', '', ApnsLog::PUSH_DOCTORAPP_VERSION_1_0, array('module' => 'LOGIN', 'id' => strtotime(XDateTime::now()))); $response->ticket = $ticket; $response->predoctor = $predoctor; }
private function updateLevelMsg($articleId, $level, $preLevel) { /*{{{*/ $article = DAL::get()->find('article', $articleId); //TODO:с╡╠ЮбК fld_ArticleTypeId=1 ╬╜╣Дндуб if ($article->level != 3 && $level == 3 && $article->level != 1) { $user = DAL::get()->find('user', $article->user->id); try { $tplname = "doctor.article.3"; $datas = array(); $datas['doctorname'] = $user->realName; $datas['articletitle'] = $article->title; //у╬дзоШо╒ $userid = $user->id; $username = $user->name; StationLetterClient::getInstance()->sendMsgByTpl($tplname, Auditor::ADMIN_USER_ID, array($userid), $datas); if ($preLevel != Article::LEVEL_0) { return false; } //╤лпе $phone = $user->mobile; $today = getdate(); $hours = $today['hours']; //мМио 21╣ЦжатГио8╣Ц ясЁы╣╫ 8╣Црт╨С if ($hours >= 21 || $hours < 8) { if ($hours < 8) { $thetime = time() + (8 - $hours) * 3600; } else { $thetime = time() + (32 - $hours) * 3600; } $sendtime = date("Y-m-d H:i:s", $thetime); SMSClient::getInstance()->sendSMSByTplName($tplname, array($phone), $datas, SMSLog::OPT_TYPE_DOCTOR_ARTICLE_LEVEL3, $sendtime, false); } else { SMSClient::getInstance()->sendSMSByTplName($tplname, array($phone), $datas, SMSLog::OPT_TYPE_DOCTOR_ARTICLE_LEVEL3); } } catch (Exception $ex) { //тщй╠╨ЖбтрЛЁё } } }
/** 把一个咨询的患者转化成患友会成员 */ public function newFromCasePatient($request, $response) { /*{{{*/ $threadId = $request->case_id; $thread = DAL::get()->find('thread', $threadId); $patient = $thread->patient; $groupId = $request->category_id; $space = $thread->space; ForumClient::getInstance()->createGroupOneMember($space, $thread->user, $thread->patient->id, $groupId); $defaultGroupId = ForumClient::getInstance()->defaultGroupMember($space->id); ForumClient::getInstance()->createGroupOneMember($space, $thread->user, $thread->patient->id, $defaultGroupId); //创建至默认组 $group = DAL::get()->find('ReGroup', $groupId); //发站内信 $msgContent = $thread->user->name . ",您好!<br/>" . $thread->space->name . "大夫已经邀请您参加患友会!<br/>建议您在疾病治疗过程中,多跟病友交流,分享经验!<br/>点这儿,<a href=" . $thread->space->getResidentEvilUrl() . " target='_blank'>去大夫患友会</a> >> "; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $thread->user->id, Box::RESIDENTEVIL_TITLE, $msgContent, array('relationShip' => $group)); $this->message('患者 ' . $patient->name . ' 已经移动到患友会 ' . $group->name . ' 分组!', $response, array('text' => '返回问题', 'url' => Ui::createUrl('Case,Detail', array('case_id' => $thread->id)))); }
/** * @brief 编辑最后一条post * @author lhl * @version branches/v2.14.23 * @date 2013-07-25 */ public function updatePost($request, $response) { /*{{{*/ $ref = DAL::get()->find('DoctorPatientRef', $request->refid); $editPostType = $request->editposttype; if ('Post' == $editPostType) { $editPost = DAL::get()->find('Post', $request->editpostid); } else { $editPost = DAL::get()->find('DoctorPatientPost', $request->editpostid); } $relateEntity = $ref; if ($ref->isNull() || false == in_array($this->user->id, array($ref->user->id, $ref->space->user->id))) { header('Location: ' . $this->space->url); return; } // 如果还有继续能回复post的就打开post回复开关 if ($ref->isClosePost()) { DoctorPatientPostClient::getInstance()->switchPatientPostCan($this->user->id, $ref->id); } $option = array(); $attachmentIds = $request->attachmentIds != null ? $request->attachmentIds : ''; $attachmentArr = explode(',', $attachmentIds); $option['attachmentIds'] = $attachmentArr; if ($ref->space->user->id == $this->user->id) { $content = $ref->space->name . "大夫和您有新对话<a href='" . $ref->url . "' target='_blank'>点击查看详情</a>"; $title = $ref->space->name . "大夫和您有新对话"; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $ref->user->id, $title, $content); } if ($editPost->isSpaceReply()) { $postContent = $request->getUnSafeData('content'); } else { $postContent = $request->content; } if (($postContent == '请填写咨询内容...' || $postContent == '') && $attachmentIds != '') { $postContent = '有新资料上传'; } $post = DoctorPatientPostClient::getInstance()->updateDoctorPatientPost($editPost->id, array('content' => $postContent, 'attachmentIds' => $attachmentArr)); if (false == $post->isNull() && $ref->user->id == $this->user->id) { //管理员给患者的提示信息失效 PatientSigninClient::getInstance()->disablePatientNotice($ref->id); } DBC::requireFalse($post->isNull(), '系统繁忙,请稍后重试'); $response->setRedirect($ref->url . "#reply"); }
public function openDevice4Today($deviceId, $os, $deviceType, $app, $vd = "", $userId = "") {/*{{{*/ if('' == trim($deviceId) || $deviceId == null) { $this->setErrorCode(179); return 0; } if('' == trim($app) || $app == null) { $this->setErrorCode(180); return 0; } $phoneRegisterLog = DAL::get()->find_by_devicetoken_and_app('phoneRegisterLog', $deviceId, $app); $isFirst = 0;//默认是第一次 if(false == $phoneRegisterLog->isNull()) { $isFirst = 1; } // 拿出这一天是不是第一次 $phoneRegisterLog2 = StationLetterClient::getInstance()->getTodayLogin($deviceId, $app); if($phoneRegisterLog2->isNull()) { StationLetterClient::getInstance()->createPhoneRegisterLog($os, $app, $deviceType, $deviceId, $vd, $isFirst); } //记录手机用户 $user = DAL::get()->find('user', $userId); if(false == $user->isNull()) { self::recordWapUser($user, $app, $os); } }/*}}}*/
header('Cache-Control: private;'); include_once($base.'/../config/config.php'); require(dirname(__FILE__).'/../assembly.php'); DAL::get()->setUp('usercenter'); $user_id = isset($_COOKIE['userinfo']['id'])?$_COOKIE['userinfo']['id']:0; $code_version = 1; $msgCount = 0; $msg = array('id' => 0, 'title' => '', 'content' => '', 'sender' => '', 'senderId' => 0); $msgNext = 0; if ($user_id > 0) { //触发站内信 PatientClubClient::getInstance()->createOffLineStationletter($user_id); $user = DAL::get()->find('user', $user_id); $msgClient = StationLetterClient::getInstance(); $msgCount = $msgClient->getUnreadMsgCount($user_id); $msgCount = (is_array($msgCount)) ? 0 : $msgCount; $username = ($_COOKIE['userinfo']['ver'] == '2.0') ? iconv('UTF-8', 'GBK', $_COOKIE['userinfo']['name']) : $_COOKIE['userinfo']['name']; $time = isset($_COOKIE['userinfo']['time'])?$_COOKIE['userinfo']['time']:0; //给用户发1月19号故障说明的站内信, 过了1月30号就不发了 by qzl //$msgClient->sendApologyLetterFor0119($user_id); if ($msgCount > 0) { $msg_alt = $msgClient->getNextUnreadMsg($user_id); if ($msg_alt) $msg = $msg_alt; //var_dump($msg); if ($msg['id']) { $sender = DAL::get()->find('User', $msg['senderId']); if ($sender->isNull())
public function unDeletedTopic($request, $response) { /*{{{*/ $topicId = $request->topicid; $topic = DAL::get()->find('ReTopic', $topicId); if ($topic->isNull()) { die('话题不存在!'); } ResidentEvilClient::getInstance()->unshieldTopic($topicId); $msgContent = "{$topic->user->name},您好!<br/>\n 您在{$topic->space->name}大夫的患友会{$topic->reboard->regroups->name}下发表的话题已被管理员恢复!<br/>\n 点这儿,<a href='http://" . URL_PREFIX . $topic->space->user->name . ".haodf.com/huanyouhui/thread/{$topicId}.htm' target='_blank'>去大夫患友会查看</a> >>\n "; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $topic->user->id, "话题恢复", $msgContent); $response->setRedirect($response->router->urlfor('residentevil/showdeletedtopiclist', array('showContent' => 1, 'page' => $request->page))); }
private function sendMsg4SrcQRcode($patientSignin, $mailContent) { $subject = "很抱歉,您的报到未通过审核!"; $mailContent = XString::htmlspecialchars_decode($mailContent); if (trim($mailContent) != "") { StationLetterClient::getInstance()->sendMsg(Auditor::ADMIN_USER_ID, array($patientSignin->user->id), $subject, $mailContent); } }
public function ajaxDoctorBuyPresent($request, $response) {/*{{{*/ $canSend = true; $errorMsg = ''; if($this->_newUser->id != $this->_newSpace->user->id) { $canSend = false; $errorMsg = "您不能代替{$this->_newSpace->name}医生送礼物!"; } $response->errorMsg = $errorMsg; if(false == $canSend) { return 'ajaxfailsent'; } $present = DAL::get()->find('Present', $request->presentid); $patient = DAL::get()->find('patient', $request->patientid); $presentOrder = PresentClient::getInstance()->createOrder($this->_newSpace->user, $patient , $this->_newSpace, $present, $request->wish, false); $result = 4; if(false == $presentOrder->isNull()) { $result = ScoreClient::getInstance()->payForPresent($this->_newSpace->user->id, $this->_newSpace->id, $presentOrder->id); } if(Account::PAY_RESULT_SUCC == $result) { $ref = DAL::get()->find_by_spaceid_and_patientid_and_status('doctorpatientref' , $this->_newSpace->id, $request->patientid, DoctorPatientRef::STATUS_INIT); $response->ref = $ref; $title = "医生送祝福"; $content = "{$patient->user->name}您好。<p>{$this->_newSpace->name}大夫亲自为您送祝福 {$present->name} </p><p><a href='{$ref->getUrl()}' class='blue' target='_blank'>立即查看</a>或<a href='{$ref->getUrl()}?type=presentchoose' class='blue' target='_blank'>我要回赠医生礼物</a></p>"; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $patient->user->id, $title, $content); return 'ajaxdoctorsuccesssent'; } else { $errorMsg = '订单提交失败'; $response->errorMsg = $errorMsg; return 'ajaxfailsent'; } }/*}}}*/
public function hasUnreadMsg($userId) {/*{{{*/ $user = DAL::get()->find('user', $userId); if ($user->isNull()) { $this->setErrorCode(107); return 0; } $hasUnread = StationLetterClient::getInstance()->getUnreadMsgCount($user->id) ? 1 : 0; $this->content = array('hasUnread' => $hasUnread); }/*}}}*/
private function sendSubscriptionMsg($userId, $title, $content, $options) { /*{{{*/ $options['ispush'] = 1; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $userId, $title, $content, $options); }
private function modifyScore($thread, $user) {/*{{{*/ $thread = DAL::get()->find('Thread', $thread->id, true); //加点 回复 根据角色加减积分 ScoreClient::getInstance()->reply($user, $thread); //判断是否是患者回复,如果是患者回复则设 cookie,为了在detail页面上做判断 if($thread->user->id == $user->id){ $cookie = new HdfCookie(); $cookie->set('replyCase',1,600); } //三级以上问题回赠积分给患者 if($user->id == $thread->space->user->id){ $result = ScoreClient::getInstance()->goodAsk($thread); if($result){ $subject = '奖励咨询点'; $score = Event::getPatientAmount('goodAsk'); $messageContent = '由于您详细填写病情资料,系统奖励:<span class="orange">+ '.$score.'咨询点</span><br><br>本奖励咨询点可用于向大夫提问问题<br>'; StationLetterClient::getInstance()->sendMsg(Auditor::ADMIN_USER_ID, array($thread->user->id), $subject, $messageContent); } } }/*}}}*/
public function getNotification($spaceId, $previousId) {/*{{{*/ $info = array(); $space = DAL::get()->find('space', $spaceId); if ($space->isNull()) { $this->setErrorCode(1191); return 0; } $doctor = DAL::get()->find('doctor', $space->host->id); $fromTime = XDateTime::now()->addHour(-1); $lastPostTime4Thread = ''; $lastPostTime4Flow = ''; $info['cntOfFlow'] = FlowClient::getInstance()->getCntOfFlow($spaceId); $oldThreadList = FlowClient::getInstance()->getOldThreadList($spaceId,1,'',array(),$fromTime); $lastFlow = array_pop($oldThreadList); if(false == empty($lastFlow)) { $lastPostTime4Flow = $lastFlow->lastPostTime->toString(); } //todo::qzl threadentity threadclient已经被废掉,下几处调用出错 // $threadIds = DAL::get()->find_id_by_spaceid_and_status('thread', $spaceId, Thread::STATUS_VALID); $spaceUnProcessCnt = 0; $serviceDef = ServiceDef::TYPE_FLOW; $spaceUnProcessCnt = DAL::get()->querySpaceNotProcessCnt('proposal', $space, $serviceDef); $info['cntOfThread'] = $spaceUnProcessCnt; $fetchCount = 1; $newProposals = DAL::get()->find_all_ProposalListAfterFromTime('proposal', $space, $fetchCount, $fromTime, $serviceDef); $lastThread = array_pop($newProposals); if(false == empty($lastThread)) { $lastPostTime4Thread = $lastThread->ctime; } $info['id'] = ''; $info['content'] = ''; if(false == empty($lastThread) || false ==empty($lastFlow)) { if($lastPostTime4Flow > $lastPostTime4Thread) { $lastPost = DAL::get()->find('doctorpatientpost', $lastFlow->lastPostId); $patientName = $lastFlow->patient->name ? $lastFlow->patient->name : $lastFlow->patient->userName; $info['id'] = $lastPost->id; $info['content'] = '老患者'.$patientName.':'.$lastPost->content; } else { $info['id'] = $lastThread->id; $info['content'] = '新患者:网络咨询请求'; if(false == empty($lastThread->province)) { $info['content'] = '来自'.$lastThread->province.'的新患者:网络咨询请求'; } } if($previousId != '' && $previousId == $info['id']) { $info['content'] = ''; } } $subContent = mb_substr($info['content'],0,20,'GBK'); if(strlen($info['content']) > 20) { $info['content'] = $subContent.'...'; } $search = array("\r\n", "\n", "\r"); $info['content'] = str_replace($search, "", $info['content']); $info['cycle'] = array('from'=>'08:00','to'=>'22:00','roundTime'=>1); $info['extra'] = array(); if($info['content'] !='') { $sign = rand(1,10000); StationLetterClient::getInstance()->recordApnsLog($space->user->id, " ", $info['content'], 1, 'anddoctor', $sign, ''); } $this->content = $info; }/*}}}*/