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 ajaxGetNextRecommendThread($request, $response) {/*{{{*/ header('Content-Type: application/json; charset=UTF-8'); //判断是否推送的判断变量 $isCanAutoPull = (false === empty($_COOKIE["userinfo"]["hosttype"]) && 'Doctor' == $_COOKIE["userinfo"]['hosttype']) ; $cookie = new HdfCookie(); $isSuccess = 0; if($isCanAutoPull && (false === isset($_COOKIE['firstlogintime']) || (false == empty($_COOKIE['firstlogintime']) && (XDateTime::hourDiff(XDateTime::valueOf($_COOKIE['firstlogintime']), XDateTime::now()) > 24)))) { $auto = ThreadClient::getInstance()->autoPullRecommendThreads($this->_newUser); if ($auto) { $cookie->set("firstlogintime", XDateTime::now(), 7*24*3600); SpaceExpClient::getInstance()->createSpaceExp($this->_newUser->id, XDateTime::now()); $isSuccess = 1; } } $unUnreadCaseCount = FlowClient::getInstance()->getUnReadCount($this->_newSpace->id); $callback = $request->callback; echo "\n".$callback.'('; echo Json::encode($unUnreadCaseCount); echo ');'; //方便测试 echo "\nisCanAuto:".$isCanAutoPull; echo "\nisSuccess:".$isSuccess; exit; }/*}}}*/
public function showHealthRecordList($request, $response) { $userId = $this->user->id; $patientId = $request->getRequest('patientId', ""); $patientInfos = $this->getHealthApplyPatientList($userId); if(empty($patientId)) { $patientId = isset($_COOKIE["_patientid"])?$_COOKIE["_patientid"]:''; } if(empty($patientId)) { $patientId = $this->getCurrentUserStatus($userId); } DBC::requireFalse(empty($patientId),'该患者没有开通'); $cookie = new HdfCookie(); $cookie->set("_patientid", $patientId); $response->patientId = $patientId; $response->patientInfos = $patientInfos; $patient = DAL::get()->find("patient", $patientId); $response->patient = $patient; $nowPage = $request->getRequest('page', 1); $res = PatientFileClient::getInstance()->getUnWaitRecordListByPatientId($patient->id, $nowPage, 3); $response->pageLink = PageNav::getNavLink( PageNav::getPageNavTemplate("/myhealth/showhealthrecordlist?patientId=".$patient->id."&page="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']); $response->records = $res['list']; }
/** * @brief * @author lhl * @version branches/v2.14.23 * @date 2013-07-25 */ private function modifyScore($ref) { /*{{{*/ ScoreClient::getInstance()->replyForFlow($this->user, $ref); //判断是否是患者回复,如果是患者回复则设 cookie,为了在detail页面上做判断 if ($ref->user->id == $this->user->id) { $cookie = new HdfCookie(); $cookie->set('replyCase', 1, 600); } }
private function addCookie($operatorId) { /*{{{*/ $this->cleanCookie(); $cookie = new HdfCookie(self::COOKIE_DOMAIN); $cookie->set("operator", $operatorId, self::COOKIE_LIVE_TIME); }
public function ajaxGetNextRecommendThread($request, $response) { /*{{{*/ $response->setHeader('Content-Type: application/json; charset=UTF-8'); $this->getLogger(); $canRecommend = $this->canRecommend(); $this->log->addDebug('canRecommend:' . (int) $canRecommend); if ($canRecommend) { $proposalIds = ProposalClient::getInstance()->autoPullRecommends($this->space); $this->log->addDebug('autoPullRecommends:', $proposalIds); if (false == empty($proposalIds)) { $cookie = new HdfCookie(); $cookie->set('firstlogintime', XDateTime::now(), 7 * 24 * 3600); $this->log->addDebug('firstlogintime:' . XDateTime::now() . '7*24*3600'); SpaceExpClient::getInstance()->createSpaceExp($this->user->id, XDateTime::now()); } } $unReadCount = FlowClient::getInstance()->getUnReadCount($this->space->id); echo "\n" . $request->callback . '(' . Json::encode($unReadCount) . ');'; return parent::DIRECT_OUTPUT; }
public function __construct($contextKey = '') { /*{{{*/ if (empty($contextKey)) { $contextKey = DebuggerContext::generatorKey(); $cookie = new HdfCookie(); $cookie->set('debugcontextkey', $contextKey, 600); } $this->contextKey = $contextKey; $this->cacher = $this->getConnect(); }
private function modifyScore(Thread $thread, User $user) { /*{{{*/ //加点 回复 根据角色加减积分 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 checkGuestId() { if (!isset($_COOKIE["g"]) || !$_COOKIE["g"]) { $GuestId = $this->generateGuestId(); $cookie = new HdfCookie(); $cookie->set("g", $GuestId, 630720000); //20 years $_COOKIE['g'] = $GuestId; } $this->GuestId = $_COOKIE['g']; return true; }