public function tmpProposalToProposal($request, $response)
 {
     /*{{{*/
     //如果意向来自拒绝意向列表,则把意向状态置为已处理
     session_start();
     $intentionIds = $_SESSION['proxyIntentionIds'];
     RefuseIntentionRecordClient::getInstance()->processRefuseIntentionRecord($intentionIds);
     $patient = DAL::get()->mustFind('Patient', $request->patientId);
     $proposals = $this->completePatientTempProposals($patient);
     //添加日志
     if (false == empty($proposals)) {
         $content = 'intentionid:' . implode(",", $intentionIds);
         $proposalIds = array();
         foreach ($proposals as $p) {
             $proposalIds[] = $p->id;
         }
         $content .= 'proposalid:' . implode(",", $proposalIds);
         S3LogClient::getInstance()->add($this->curInspector, $patient->getLogable()->action(PatientLog::ACTION_PROXY_ADD_PROPOSAL, $content));
     }
     //绑定支付宝公共账号用户
     foreach ($proposals as $proposal) {
         S3LogClient::getInstance()->add($this->curInspector, $proposal->getLogable()->action($this->getBuGroup($proposal->inspectGroup->id), $proposal->remark));
         if ($proposal->product->isTelProduct()) {
             MobileClient::getInstance()->bindAlipayUser($proposal->user, $proposal);
         }
     }
     $url = $response->router->urlfor('intention/showaddproposal', array('patientid' => $patient->id));
     $response->setRedirect($url);
 }
예제 #2
0
 public function removeDoctorUser($request, $response)
 {
     /*{{{*/
     if ($request->username == '') {
         return;
     }
     $user = UserClient::getInstance()->getByUserName($request->username);
     if ($user->isNull()) {
         $response->msg = "用户名不存在!";
         return;
     }
     $preDoctor = DAL::get()->find_by_userid('predoctor', $user->id);
     if ($user->hasSpace() == false && $preDoctor->isNull()) {
         $response->msg = "无效的医生用户名!";
         return;
     }
     MobileClient::getInstance()->removeDoctorUser($user->id);
     $response->msg = "医生解绑成功!";
 }
    public function sendExceptionMsg($userId, $platform, $deviceOS, $deviceVersion, $deviceIMEI, $appVersion, $exceptionType, $exception)
    {/*{{{*/
		$request = new Request();
        if ($userId)
        {
            $user = DAL::get()->find('user', $userId);
            if ($user->isNull())
            {
                $userId = 0;
            }
        }
        MobileClient::getInstance()->sendExceptionMsg($userId, $platform, $deviceOS, $deviceVersion, $deviceIMEI, $appVersion, $exceptionType, $exception);
    }/*}}}*/
 private function unfollow($alipayUserId)
 {/*{{{*/
     MobileClient::getInstance()->unfollowAlipayUser($alipayUserId);
 }/*}}}*/